@lemmaoracle/seal 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@lemmaoracle/seal",
3
+ "version": "0.1.1",
4
+ "description": "Seal — ZK auth circuit for Lemma dashboard Proof-based sign-in. Proves knowledge of an API key pre-image without revealing the key.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./vkey": {
14
+ "types": "./dist/vkey.d.ts",
15
+ "import": "./dist/vkey.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "circuits/src/seal-identity.circom",
21
+ "circuits/scripts/build.sh",
22
+ "scripts/setup-toolchain.sh"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsc -p tsconfig.json",
26
+ "build:circuit": "cd circuits && npm run build",
27
+ "type-check": "tsc --noEmit",
28
+ "test": "vitest run",
29
+ "test:circuit": "cd circuits && npx vitest run",
30
+ "register:circuit": "tsx scripts/register-circuit.ts"
31
+ },
32
+ "keywords": [
33
+ "lemma",
34
+ "seal",
35
+ "auth",
36
+ "zk",
37
+ "circuit",
38
+ "sign-in"
39
+ ],
40
+ "dependencies": {
41
+ "@lemmaoracle/sdk": "^0.0.23",
42
+ "@lemmaoracle/spec": "^0.0.23",
43
+ "snarkjs": "^0.7.6"
44
+ },
45
+ "devDependencies": {
46
+ "@types/snarkjs": "^0.7.9",
47
+ "dotenv": "16.4.7",
48
+ "tsx": "^4.19.0",
49
+ "typescript": "5.8.3",
50
+ "vitest": "^3.1.1"
51
+ },
52
+ "author": "Lemma Oracle",
53
+ "license": "MIT"
54
+ }
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Install the toolchain needed to compile the seal circuit.
4
+ #
5
+ # Required:
6
+ # - Rust + Cargo — circom is built from source via cargo
7
+ # - circom 2.1.x — the circuit compiler
8
+ # - Node.js >= 18 — snarkjs runs on Node
9
+ #
10
+ # snarkjs and circomlib are installed as circuits/ dependencies by
11
+ # `npm install` and need no global install.
12
+ #
13
+ set -euo pipefail
14
+
15
+ CIRCOM_VERSION="v2.1.9"
16
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
17
+
18
+ echo "seal toolchain setup"
19
+ echo "===================="
20
+
21
+ # 1. Rust / Cargo
22
+ if command -v cargo >/dev/null 2>&1; then
23
+ echo "✓ cargo present: $(cargo --version)"
24
+ else
25
+ echo "→ installing Rust via rustup"
26
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
27
+ # shellcheck disable=SC1091
28
+ source "$HOME/.cargo/env"
29
+ fi
30
+
31
+ # 2. circom 2.1.x
32
+ if command -v circom >/dev/null 2>&1; then
33
+ echo "✓ circom present: $(circom --version)"
34
+ else
35
+ echo "→ building circom $CIRCOM_VERSION from source"
36
+ TMP="$(mktemp -d)"
37
+ git clone --depth 1 --branch "$CIRCOM_VERSION" \
38
+ https://github.com/iden3/circom.git "$TMP/circom"
39
+ cargo install --path "$TMP/circom/circom"
40
+ rm -rf "$TMP"
41
+ echo "✓ circom installed: $(circom --version)"
42
+ fi
43
+
44
+ # 3. Node.js
45
+ if command -v node >/dev/null 2>&1; then
46
+ echo "✓ node present: $(node --version)"
47
+ else
48
+ echo "✗ Node.js >= 18 is required — install it, then re-run this script" >&2
49
+ exit 1
50
+ fi
51
+
52
+ # 4. circuit JS dependencies (snarkjs, circomlib)
53
+ echo "→ installing circuit dependencies"
54
+ ( cd "$SCRIPT_DIR/../circuits" && npm install )
55
+
56
+ echo ""
57
+ echo "✓ toolchain ready — build the circuit with:"
58
+ echo " cd packages/seal/circuits && npm run build"