Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
},
Expand Down
1 change: 0 additions & 1 deletion src/disclosure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 0 additions & 5 deletions tests/integration/disclosure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down
15 changes: 1 addition & 14 deletions tests/unit/disclosure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down