From 7e3c89cbe3ba8124761fedcbf2884633c9913656 Mon Sep 17 00:00:00 2001 From: nol4lej Date: Sun, 8 Mar 2026 01:50:23 -0300 Subject: [PATCH 1/2] chore: update version to 3.3.2 and bump @orbinum/circuits dependency to ^0.4.2 --- CHANGELOG.md | 23 +++++++++++++++++++++++ package-lock.json | 12 ++++++------ package.json | 4 ++-- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1621ad1..da2db10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.3.2] - 2026-03-08 + +### Changed + +- **`@orbinum/circuits` bumped** from `^0.4.1` to `^0.4.2` — removes redundant + `viewing_key` private input from the disclosure circuit (ownership is already + proven by the commitment constraint) and normalizes all circuit comments to + English. +- **`src/disclosure.ts`** — removed `viewing_key` from the witness input object + passed to snarkjs; the signal no longer exists in the circuit. The + `Poseidon(owner_pubkey)` value is still computed internally and used as + `revealed_owner_hash` when `mask.discloseOwner` is `true`. + +### Removed + +- **`viewing_key` witness signal** from `buildCircuitInputs()` in + `src/disclosure.ts` — was `Poseidon(owner_pubkey)`, now inlined into + `revealed_owner_hash` only. +- **Unit test** `should include viewing_key = mocked Poseidon(owner_pubkey)` in + `tests/unit/disclosure.test.ts` — no longer applicable. +- **`viewing_key` field** from the raw inputs object in + `tests/integration/disclosure.test.ts`. + ## [3.3.1] - 2026-03-07 ### Changed diff --git a/package-lock.json b/package-lock.json index 6c0df86..cbe966b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@orbinum/proof-generator", - "version": "3.3.1", + "version": "3.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@orbinum/proof-generator", - "version": "3.3.1", + "version": "3.3.2", "license": "GPL-3.0-or-later OR Apache-2.0", "dependencies": { - "@orbinum/circuits": "^0.4.1", + "@orbinum/circuits": "^0.4.2", "@orbinum/groth16-proofs": "^2.0.0", "snarkjs": "0.7.5" }, @@ -1654,9 +1654,9 @@ } }, "node_modules/@orbinum/circuits": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@orbinum/circuits/-/circuits-0.4.1.tgz", - "integrity": "sha512-qtHGRuTFqdG+hOis19j9A445NCbt5dWhVMHQz4mVTXBymJl87tWhuX4A2iL0amKnwL/A68ZxfJVjBTI6HzMpBw==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@orbinum/circuits/-/circuits-0.4.2.tgz", + "integrity": "sha512-26q2elFm4UVOMwZtmGDkK4E0ad1FSqgMBo0cJjLRQQp0qx7ca2HPFj0LM8lSMPHLfyuYEtKRof5xoIXQftS4XA==", "license": "GPL-3.0", "engines": { "node": ">=18.0.0" diff --git a/package.json b/package.json index e57a6d0..ac7f0d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orbinum/proof-generator", - "version": "3.3.1", + "version": "3.3.2", "description": "ZK-SNARK proof generator for Orbinum. Combines snarkjs (witness) with arkworks WASM (proof generation) to produce 128-byte Groth16 proofs.", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -42,7 +42,7 @@ "orbinum" ], "dependencies": { - "@orbinum/circuits": "^0.4.1", + "@orbinum/circuits": "^0.4.2", "@orbinum/groth16-proofs": "^2.0.0", "snarkjs": "0.7.5" }, From b90f2c98d756b63c5eead9312b670b7122f1f235 Mon Sep 17 00:00:00 2001 From: nol4lej Date: Sun, 8 Mar 2026 01:50:34 -0300 Subject: [PATCH 2/2] chore: remove viewing_key from circuit inputs and tests for disclosure proof generation --- src/disclosure.ts | 1 - tests/integration/disclosure.test.ts | 5 ----- tests/unit/disclosure.test.ts | 15 +-------------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/disclosure.ts b/src/disclosure.ts index 7b2f218..c44e016 100644 --- a/src/disclosure.ts +++ b/src/disclosure.ts @@ -60,7 +60,6 @@ async function buildCircuitInputs( asset_id: u64ToFieldStr(assetId), owner_pubkey: ownerPubkey.toString(), blinding: blinding.toString(), - viewing_key: viewingKey.toString(), disclose_value: mask.discloseValue ? '1' : '0', disclose_asset_id: mask.discloseAssetId ? '1' : '0', disclose_owner: mask.discloseOwner ? '1' : '0', diff --git a/tests/integration/disclosure.test.ts b/tests/integration/disclosure.test.ts index 19caf3b..ad765b2 100644 --- a/tests/integration/disclosure.test.ts +++ b/tests/integration/disclosure.test.ts @@ -37,10 +37,6 @@ describe('Integration: Disclosure Proof Generation', () => { const commitment = poseidon([noteValue, assetId, ownerPubkey, blinding]); const commitmentBigInt = F.toObject(commitment); - // Compute viewing_key = Poseidon(owner_pubkey) - const viewingKey = poseidon([ownerPubkey]); - const viewingKeyBigInt = F.toObject(viewingKey); - // Compute revealed_owner_hash = Poseidon(owner_pubkey) for this test const revealedOwnerHash = poseidon([ownerPubkey]); const revealedOwnerHashBigInt = F.toObject(revealedOwnerHash); @@ -57,7 +53,6 @@ describe('Integration: Disclosure Proof Generation', () => { asset_id: assetId.toString(), owner_pubkey: ownerPubkey.toString(), blinding: blinding.toString(), - viewing_key: viewingKeyBigInt.toString(), // Disclosure masks disclose_value: '0', // 0 = no revelar disclose_asset_id: '0', // 0 = no revelar diff --git a/tests/unit/disclosure.test.ts b/tests/unit/disclosure.test.ts index d988848..e6be472 100644 --- a/tests/unit/disclosure.test.ts +++ b/tests/unit/disclosure.test.ts @@ -8,7 +8,7 @@ * - Mock `../../src/index` (generateProof) to return crafted public signals. * - Test everything the disclosure orchestrator does: * 1. Mask validation (all-false must throw) - * 2. Circuit inputs built with correct values and viewing_key + * 2. Circuit inputs built with correct values * 3. `revealedData` decoded correctly from public signals for all mask combos * 4. Proof / publicSignals forwarded as-is * 5. Helper round-trips: bigIntToBytes32 ↔ bytes32ToBigInt @@ -214,19 +214,6 @@ describe('generateDisclosureProof - circuit inputs', () => { expect(inputs.commitment).toBe(COMMITMENT.toString()); }); - it('should include viewing_key = mocked Poseidon(owner_pubkey)', async () => { - const mask: DisclosureMask = { - discloseValue: true, - discloseAssetId: false, - discloseOwner: false, - }; - - await generateDisclosureProof(NOTE_VALUE, OWNER_PUBKEY, BLINDING, ASSET_ID, COMMITMENT, mask); - - const [, inputs] = mockGenerateProof.mock.calls.at(-1)!; - expect(inputs.viewing_key).toBe(MOCK_VIEWING_KEY.toString()); - }); - it('should set disclose_value=1 when mask.discloseValue is true', async () => { const mask: DisclosureMask = { discloseValue: true,