hyli-noir 0.0.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/README.md +35 -0
- package/dist/check_secret.d.ts +44 -0
- package/dist/hyli-noir.cjs.js +2 -0
- package/dist/hyli-noir.cjs.js.map +1 -0
- package/dist/hyli-noir.es.js +175 -0
- package/dist/hyli-noir.es.js.map +1 -0
- package/dist/lib.d.ts +2 -0
- package/package.json +46 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyli-noir.es.js","sources":["../node_modules/@noir-lang/noir_js/lib/base64_decode.mjs","../node_modules/@noir-lang/noir_js/lib/witness_generation.mjs","../node_modules/@noir-lang/noir_js/lib/program.mjs","../src/check_secret.ts"],"sourcesContent":["// Since this is a simple function, we can use feature detection to\n// see if we are in the nodeJs environment or the browser environment.\nexport function base64Decode(input) {\n if (typeof Buffer !== 'undefined') {\n // Node.js environment\n return Buffer.from(input, 'base64');\n }\n else if (typeof atob === 'function') {\n // Browser environment\n return Uint8Array.from(atob(input), (c) => c.charCodeAt(0));\n }\n else {\n throw new Error('No implementation found for base64 decoding.');\n }\n}\n","import { abiDecodeError, abiEncode } from '@noir-lang/noirc_abi';\nimport { base64Decode } from \"./base64_decode.mjs\";\nimport { executeProgram } from '@noir-lang/acvm_js';\nconst defaultForeignCallHandler = async (name, args) => {\n if (name == 'print') {\n // By default we do not print anything for `print` foreign calls due to a need for formatting,\n // however we provide an empty response in order to not halt execution.\n //\n // If a user needs to print values then they should provide a custom foreign call handler.\n return [];\n }\n throw Error(`Unexpected oracle during execution: ${name}(${args.join(', ')})`);\n};\nfunction parseErrorPayload(abi, originalError) {\n const payload = originalError.rawAssertionPayload;\n if (!payload)\n return originalError;\n const enrichedError = originalError;\n try {\n // Decode the payload\n const decodedPayload = abiDecodeError(abi, payload);\n if (typeof decodedPayload === 'string') {\n // If it's a string, just add it to the error message\n enrichedError.message = `Circuit execution failed: ${decodedPayload}`;\n }\n else {\n // If not, attach the payload to the original error\n enrichedError.decodedAssertionPayload = decodedPayload;\n }\n }\n catch (_errorDecoding) {\n // Ignore errors decoding the payload\n }\n return enrichedError;\n}\n// Generates the witnesses needed to feed into the chosen proving system\nexport async function generateWitness(compiledProgram, inputs, foreignCallHandler = defaultForeignCallHandler) {\n // Throws on ABI encoding error\n const witnessMap = abiEncode(compiledProgram.abi, inputs);\n // Execute the circuit to generate the rest of the witnesses and serialize\n // them into a Uint8Array.\n try {\n const solvedWitness = await executeProgram(base64Decode(compiledProgram.bytecode), witnessMap, foreignCallHandler);\n return solvedWitness;\n }\n catch (err) {\n // Typescript types catched errors as unknown or any, so we need to narrow its type to check if it has raw assertion payload.\n if (typeof err === 'object' && err !== null && 'rawAssertionPayload' in err) {\n throw parseErrorPayload(compiledProgram.abi, err);\n }\n throw new Error(`Circuit execution failed: ${err}`);\n }\n}\n","import { generateWitness } from \"./witness_generation.mjs\";\nimport initAbi, { abiDecode } from '@noir-lang/noirc_abi';\nimport initACVM, { compressWitnessStack } from '@noir-lang/acvm_js';\nexport class Noir {\n circuit;\n constructor(circuit) {\n this.circuit = circuit;\n }\n /** @ignore */\n async init() {\n // If these are available, then we are in the\n // web environment. For the node environment, this\n // is a no-op.\n if (typeof initAbi === 'function') {\n await Promise.all([initAbi(), initACVM()]);\n }\n }\n /**\n * @description\n * Allows to execute a circuit to get its witness and return value.\n *\n * @example\n * ```typescript\n * async execute(inputs)\n * ```\n */\n async execute(inputs, foreignCallHandler) {\n await this.init();\n const witness_stack = await generateWitness(this.circuit, inputs, foreignCallHandler);\n const main_witness = witness_stack[0].witness;\n const { return_value: returnValue } = abiDecode(this.circuit.abi, main_witness);\n return { witness: compressWitnessStack(witness_stack), returnValue };\n }\n}\n","import { Noir } from \"@noir-lang/noir_js\";\nimport { reconstructHonkProof, UltraHonkBackend } from \"@aztec/bb.js\";\nimport { CompiledCircuit, InputMap } from \"@noir-lang/types\";\nimport { Blob, ProofTransaction, NodeApiHttpClient } from \"hyli\";\n\n/**\n * Builds a blob transaction containing a secret derived from an identity and password.\n * The secret is constructed by:\n * 1. Hashing the password in order to have a fixed-size secret\n * 2. Concatenating the padded identity (to 64 chars) with ':' and the hashed password\n * 3. Hashing this combined value\n *\n * @param identity - The user's identity string\n * @param password - The user's password string\n * @returns A Promise resolving to a BlobTransaction containing the hashed secret\n */\nexport const build_blob = async (\n identity: string,\n password: string,\n): Promise<Blob> => {\n const hashed_password_bytes = await sha256(stringToBytes(password));\n let encoder = new TextEncoder();\n let id_prefix = encoder.encode(`${identity}:`);\n let extended_id = new Uint8Array([...id_prefix, ...hashed_password_bytes]);\n const stored_hash = await sha256(extended_id);\n\n const secretBlob: Blob = {\n contract_name: \"check_secret\",\n data: Array.from(stored_hash),\n };\n\n return secretBlob;\n};\n\nimport defaultCircuit from \"../check-secret/target/check_secret.json\";\n\n/**\n * Builds a proof transaction by generating a zero-knowledge proof for checking a secret.\n * The proof demonstrates knowledge of a password that, when combined with an identity and hashed,\n * matches a stored hash value. The process involves:\n * 1. Hashing the password and combining it with the identity\n * 2. Generating a witness and proof using the UltraHonk backend\n * 3. Reconstructing and formatting the proof for the transaction\n *\n * @param identity - The user's identity string\n * @param password - The user's password string\n * @param tx_hash - The blob transaction hash string\n * @param circuit - The compiled Noir circuit (defaults to the check_secret circuit)\n * @returns A Promise resolving to a ProofTransaction containing the generated proof\n */\nexport const build_proof_transaction = async (\n identity: string,\n password: string,\n tx_hash: string,\n blob_index: number,\n tx_blob_count: number,\n circuit: CompiledCircuit = defaultCircuit as CompiledCircuit,\n): Promise<ProofTransaction> => {\n const noir = new Noir(circuit);\n const backend = new UltraHonkBackend(circuit.bytecode);\n const vk = await backend.getVerificationKey();\n\n const hashed_password_bytes = await sha256(stringToBytes(password));\n let encoder = new TextEncoder();\n let id_prefix = encoder.encode(`${identity}:`);\n let extended_id = new Uint8Array([...id_prefix, ...hashed_password_bytes]);\n const stored_hash = await sha256(extended_id);\n\n const { witness } = await noir.execute(\n generateProverData(\n identity,\n hashed_password_bytes,\n stored_hash,\n tx_hash,\n blob_index,\n tx_blob_count,\n ),\n );\n\n const proof = await backend.generateProof(witness);\n const reconstructedProof = reconstructHonkProof(\n flattenFieldsAsArray(proof.publicInputs),\n proof.proof,\n );\n\n return {\n contract_name: \"check_secret\",\n program_id: Array.from(vk),\n verifier: \"noir\",\n proof: Array.from(reconstructedProof),\n };\n};\n\n/**\n * Registers the Noir contract with the node if it is not already registered.\n * The contract is identified by its name \"check_secret\".\n * If the contract is not found, it registers the contract using the provided circuit.\n *\n * @param node - The NodeApiHttpClient instance to interact with the NodeApiHttpClient\n * @param circuit - The compiled Noir circuit (defaults to the check_secret circuit)\n * @returns A Promise that resolves when the contract is registered\n */\nexport const register_contract = async (\n node: NodeApiHttpClient,\n circuit: CompiledCircuit = defaultCircuit as CompiledCircuit,\n): Promise<void> => {\n await node.getContract(\"check_secret\").catch(async () => {\n const backend = new UltraHonkBackend(circuit.bytecode);\n\n const vk = await backend.getVerificationKey();\n\n await node.registerContract({\n verifier: \"noir\",\n program_id: Array.from(vk),\n state_commitment: [0, 0, 0, 0],\n contract_name: \"check_secret\",\n });\n });\n};\n\n// ---- Utility functions ----\n\nexport const assert = (condition: boolean, message: string): void => {\n if (!condition) {\n throw new Error(message);\n }\n};\n\nexport const sha256 = async (data: Uint8Array): Promise<Uint8Array> => {\n const hashBuffer = await crypto.subtle.digest(\"SHA-256\", data);\n return new Uint8Array(hashBuffer);\n};\n\nexport const stringToBytes = (input: string): Uint8Array => {\n return new TextEncoder().encode(input);\n};\n\nexport const encodeToHex = (data: Uint8Array): string => {\n return Array.from(data)\n .map((byte) => byte.toString(16).padStart(2, \"0\"))\n .join(\"\");\n};\n\nexport function flattenFieldsAsArray(fields: string[]): Uint8Array {\n const flattenedPublicInputs = fields.map(hexToUint8Array);\n return flattenUint8Arrays(flattenedPublicInputs);\n}\n\nfunction flattenUint8Arrays(arrays: Uint8Array[]): Uint8Array {\n const totalLength = arrays.reduce((acc, val) => acc + val.length, 0);\n const result = new Uint8Array(totalLength);\n\n let offset = 0;\n for (const arr of arrays) {\n result.set(arr, offset);\n offset += arr.length;\n }\n\n return result;\n}\n\nfunction hexToUint8Array(hex: string): Uint8Array {\n const sanitisedHex = BigInt(hex).toString(16).padStart(64, \"0\");\n\n const len = sanitisedHex.length / 2;\n const u8 = new Uint8Array(len);\n\n let i = 0;\n let j = 0;\n while (i < len) {\n u8[i] = parseInt(sanitisedHex.slice(j, j + 2), 16);\n i += 1;\n j += 2;\n }\n\n return u8;\n}\n\n/**\n * Generates the prover data required for the Noir circuit.\n *\n * @param id - The user's identity string\n * @param pwd - The hashed password as a Uint8Array\n * @param stored_hash - The stored hash as a Uint8Array\n * @param tx - The transaction hash string\n * @returns An object containing the prover data\n */\nconst generateProverData = (\n id: string,\n pwd: Uint8Array,\n stored_hash: Uint8Array,\n tx: string,\n blob_index: number,\n tx_blob_count: number,\n): InputMap => {\n const version = 1;\n const initial_state = [0, 0, 0, 0];\n const initial_state_len = initial_state.length;\n const next_state = [0, 0, 0, 0];\n const next_state_len = next_state.length;\n const identity_len = id.length;\n const identity = id.padEnd(256, \"0\");\n const tx_hash = tx.padEnd(64, \"0\");\n const tx_hash_len = tx_hash.length;\n const index = blob_index;\n const blob_number = 1;\n const blob_contract_name_len = \"check_secret\".length;\n const blob_contract_name = \"check_secret\".padEnd(256, \"0\");\n const blob_capacity = 32;\n const blob_len = 32;\n const blob: number[] = Array.from(stored_hash);\n const success = 1;\n const password: number[] = Array.from(pwd);\n assert(password.length == 32, \"Password length is not 32 bytes\");\n assert(blob.length == blob_len, \"Blob length is not 32 bytes\");\n\n return {\n version,\n initial_state,\n initial_state_len,\n next_state,\n next_state_len,\n identity,\n identity_len,\n tx_hash,\n tx_hash_len,\n index,\n blob_number,\n blob_index,\n blob_contract_name_len,\n blob_contract_name,\n blob_capacity,\n blob_len,\n blob,\n tx_blob_count,\n success,\n password,\n };\n};\n"],"names":["base64Decode","input","c","defaultForeignCallHandler","name","args","parseErrorPayload","abi","originalError","payload","enrichedError","decodedPayload","abiDecodeError","generateWitness","compiledProgram","inputs","foreignCallHandler","witnessMap","abiEncode","executeProgram","err","Noir","circuit","__publicField","initAbi","initACVM","witness_stack","main_witness","returnValue","abiDecode","compressWitnessStack","build_blob","identity","password","hashed_password_bytes","sha256","stringToBytes","id_prefix","extended_id","stored_hash","build_proof_transaction","tx_hash","blob_index","tx_blob_count","defaultCircuit","noir","backend","UltraHonkBackend","vk","witness","generateProverData","proof","reconstructedProof","reconstructHonkProof","flattenFieldsAsArray","register_contract","node","assert","condition","message","data","hashBuffer","encodeToHex","byte","fields","flattenedPublicInputs","hexToUint8Array","flattenUint8Arrays","arrays","totalLength","acc","val","result","offset","arr","hex","sanitisedHex","len","u8","i","j","id","pwd","tx","initial_state","initial_state_len","next_state","next_state_len","identity_len","tx_hash_len","index","blob_number","blob_contract_name_len","blob_contract_name","blob_capacity","blob_len","blob","success"],"mappings":";;;;;;AAEO,SAASA,EAAaC,GAAO;AAChC,MAAI,OAAO,SAAW;AAElB,WAAO,OAAO,KAAKA,GAAO,QAAQ;AAEjC,MAAI,OAAO,QAAS;AAErB,WAAO,WAAW,KAAK,KAAKA,CAAK,GAAG,CAACC,MAAMA,EAAE,WAAW,CAAC,CAAC;AAG1D,QAAM,IAAI,MAAM,8CAA8C;AAEtE;ACXA,MAAMC,IAA4B,OAAOC,GAAMC,MAAS;AACpD,MAAID,KAAQ;AAKR,WAAO,CAAE;AAEb,QAAM,MAAM,uCAAuCA,CAAI,IAAIC,EAAK,KAAK,IAAI,CAAC,GAAG;AACjF;AACA,SAASC,EAAkBC,GAAKC,GAAe;AAC3C,QAAMC,IAAUD,EAAc;AAC9B,MAAI,CAACC;AACD,WAAOD;AACX,QAAME,IAAgBF;AACtB,MAAI;AAEA,UAAMG,IAAiBC,EAAeL,GAAKE,CAAO;AAClD,IAAI,OAAOE,KAAmB,WAE1BD,EAAc,UAAU,6BAA6BC,CAAc,KAInED,EAAc,0BAA0BC;AA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,GACAzC,GACAC,MACa;AAEb,QAAMyC,IAAgB,CAAC,GAAG,GAAG,GAAG,CAAC,GAC3BC,IAAoBD,EAAc,QAClCE,IAAa,CAAC,GAAG,GAAG,GAAG,CAAC,GACxBC,IAAiBD,EAAW,QAC5BE,IAAeP,EAAG,QAClBjD,IAAWiD,EAAG,OAAO,KAAK,GAAG,GAC7BxC,IAAU0C,EAAG,OAAO,IAAI,GAAG,GAC3BM,IAAchD,EAAQ,QACtBiD,IAAQhD,GACRiD,IAAc,GACdC,IAAyB,IACzBC,IAAqB,eAAe,OAAO,KAAK,GAAG,GACnDC,IAAgB,IAChBC,IAAW,IACXC,IAAiB,MAAM,KAAKzD,CAAW,GACvC0D,IAAU,GACVhE,IAAqB,MAAM,KAAKiD,CAAG;AAClC,SAAAzB,EAAAxB,EAAS,UAAU,IAAI,iCAAiC,GACxDwB,EAAAuC,EAAK,UAAUD,GAAU,6BAA6B,GAEtD;AAAA,IACL;AAAA,IACA,eAAAX;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAvD;AAAA,IACA,cAAAwD;AAAA,IACA,SAAA/C;AAAA,IACA,aAAAgD;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAjD;AAAA,IACA,wBAAAkD;AAAA,IACA,oBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,eAAArD;AAAA,IACA,SAAAsD;AAAA,IACA,UAAAhE;AAAA,EACF;AACF;;;;;;;;;;;","x_google_ignoreList":[0,1,2]}
|
package/dist/lib.d.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hyli-noir",
|
|
3
|
+
"description": "A library of noir programs used by Hyli.",
|
|
4
|
+
"author": "Hyli",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"version": "0.0.1",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/hyli-noir.cjs.js",
|
|
9
|
+
"module": "dist/hyli-noir.es.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/lib.d.ts",
|
|
13
|
+
"default": "./dist/hyli-noir.es.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/lib.d.ts",
|
|
17
|
+
"default": "./dist/hyli-noir.cjs.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"types": "dist/lib.d.ts",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"dev": "vite",
|
|
26
|
+
"build": "rm -rf dist && vite build && tsc && tsc-alias",
|
|
27
|
+
"prepublishOnly": "bun run build",
|
|
28
|
+
"pub": "npm publish"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@aztec/bb.js": "0.82.2",
|
|
32
|
+
"@noir-lang/noir_js": "1.0.0-beta.2",
|
|
33
|
+
"@noir-lang/noir_wasm": "1.0.0-beta.2"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"hyli": "^0.4.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/bun": "^1.2.14",
|
|
40
|
+
"tsc-alias": "^1.8.16",
|
|
41
|
+
"esbuild": "^0.20.2",
|
|
42
|
+
"typescript": "^5.8.3",
|
|
43
|
+
"vite": "^6.3.5",
|
|
44
|
+
"vite-bundle-analyzer": "^0.21.0"
|
|
45
|
+
}
|
|
46
|
+
}
|