Repository navigation
Conversation
Ballots were Poseidon(vote, nullifier) with a public nullifier, so every vote could be decoded from chain data. Replace them with exponential ElGamal on Jubjub under an election key shared n-of-n by three trustees (ADR-0005). The ballot proof shows eligibility, the nullifier, and that (A, B) encrypts 0 or 1; the sum of all ballots is decrypted once, after an on-chain deadline, with a Groth16 DLEQ proof per trustee share. Also closes binding gaps found while redesigning: - G1: election id, voter root and election key are script parameters - G2: the list key is the nullifier; the stored ballot is the proved one; exactly one unit of the nullifier token may exist in the outputs - G3: an insert spends exactly one list node; node values are exact - G4: ballots must be valid no later than the voting deadline - G5: the list root is one-shot (seed output) The tally walks the list from its root and fails closed, publishes a ballot-set digest, and re-verifies the manifest, script hashes, key proofs, share proofs and the total from public data. Tests: host ElGamal vs an independent Python reference, circuit negatives, Plutus VM mutations for every gap, DevKit E2E election. Builds against a local ZeroJ 0.1.0-pre13 snapshot (bloxbean/zeroj#73). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- P1: the continuing anchor's datum and the list root are now exact on-chain. A field-by-field read accepted ListElement with an extra field, which the off-chain walk rejects, so anyone copying a mempool ballot could make the election untallyable. Off-chain parsing mirrors on-chain acceptance (constructor 0, exactly two fields). - Tests: the pre-minted copy placed after the node (the order a "last holder wins" read would accept), N + p nullifier names, foreign election id / key, staked outputs, non-root anchors (order violation, duplicate key, dropped nullifier), exact root. Removing the one-unit rule or the exact anchor datum now fails a VM test (checked). - DevKit: the double vote and the post-deadline ballot are forced past the client and rejected by the scripts on the ledger path. - Manifest: full verification keys and parameter-applied scripts; the seed is bound to chain data (root token minted once, by the seed's spender). - Tally reads chain time before ballots; the ballot-set digest is domain-separated and bound to the election id and list policy; status no longer deploys scripts; creating an election is refused once one is finalized; key caches are keyed by an R1CS digest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New usecase project (ADR-0006) with Pedersen commitment demos on Yaci DevKit. A. Confidential points: notes whose amounts are pedersen-jubjub-v1 commitments. PointsLedger (one multi-validator: policy + note address) issues notes (issuer-signed), splits a note with a proof of in = out1 + out2 over hidden 64-bit amounts, and redeems a public price with a proof of in = change + price; a redemption mints a receipt token named after the redeemed note, so receipts cannot be forged or replayed. B. Committed credential gate: a bureau commits to a credit profile (income, credit_score, birth_year, country) as one vector commitment and records the issuance on-chain (token name binds u, v, σ, holder). CreditGatePolicy mints a badge, paid to the holder, for a proof of income >= min and credit_score >= min against the record, revealing nothing else. Tests: circuit honest/negative cases, Plutus VM mutation tests for every invariant (P1-P8, C1-C5), and DevKit end-to-end runs with on-ledger script rejections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C. Solvency with hidden liabilities (Provisions-style): one commitment per customer balance, a proof that the hidden total is at most the reserve locked in SolvencyVault, a per-customer inclusion check by opening, and an auditor opening of the total by homomorphism. The vault keeps the reserve and the attestation fixed until unlockAfter (release burns the token), so reserves cannot back two attestations or be swapped out. Also: the ./gradlew run walkthrough of all three demos on DevKit, the project README, and registration in build.gradle, build-all.sh and the repository README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- P0 (solvency): the same reserves could back attestations one after another (attest, let customers check, release, re-attest for others). Attestations are now bound to a public period: each period has its own vault script; attest only with a validity range ending by periodStart, release only from periodEnd, vault output at the exact enterprise address. Every attestation of a period is locked for the whole period at once (ADR-0006 r3, S7). - Customer check: derive the period's vault script, read every live attestation at its address, require the entry exactly once across all of them. ADR states the id-uniqueness and trusted-setup requirements. - Points: the receipt names the spender, not the change owner (wallet bug); the price binding is now isolated in the VM test (redeemer and receipt agree, only the proof rejects); new mint-side negatives (Split with no note spent, Receipt with zero or two notes or a short name); the two-token note mutation is isolated. - Credential: the non-canonical u mutation is isolated (record built for the same u + p). - Removing Split's one-input rule or the vault's period-start bound now fails a VM test (checked). Circuit allows N <= 16 (on-chain budget). - Wording: test rejections are scripts failing in local Julc evaluation, as the node would run them; rejected transactions are not submitted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd 2) The guarantee is per period: each period's attestations must cover the whole book, customers check every period they rely on, the schedule publishes every vault parameter set for a period, and periodStart < periodEnd is enforced where customers derive the vault. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Turn the module into a Spring Boot app (port 8093) like the other usecases. Thin services drive the existing engine (ConfidentialPoints, CreditGate, SolvencyAttestation) on Yaci DevKit: they create and fund the demo wallets, hold the openings on the users' behalf, and expose the private and the on-chain view of each demo plus its actions, including the "try to cheat" ones. A false statement maps to "no proof possible" (422); a validator rejection maps to an onChainValidation body (403). Circuits and wallets warm up in the background; /api/status reports readiness. The CLI walkthrough moves to `./gradlew walkthrough`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Svelte 5 + Vite (native fetch, no axios), built into src/main/resources/static with -PwithFrontend. Each tab shows the private side (openings held by the demo server) next to the on-chain side, with actions and "try to cheat" cases: - points: issue, transfer, redeem; overspend (no proof), spend someone else's note (rejected); - credential: issue and record, claim a badge; threshold above the profile (no proof), impostor claim (rejected); - solvency: book, attest for a period with a countdown, customer checks, auditor opening, release; insolvent (no proof), a second attestation or a release inside the period (rejected). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`./demo.sh pedersen` (alias of pedersen-commitments, port 8093) with a --run happy path, a compose.demo.yml service and volume, and a demo-cache manifest (no setup files committed; setups are generated on first start). The README documents the UI, its tabs and configuration; the root README lists the demo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Web UI for
|
| Tab | Actions | Try to cheat |
|---|---|---|
| A. Confidential points | Issue, transfer (amounts hidden), redeem at a public price (the retailer gets a receipt token) | Overspend: no proof possible. Spend someone else's note: validator rejects |
| B. Committed credential | Bureau issues and records a profile; Alice claims a badge against the lender's thresholds | Threshold above her profile: no proof possible. Mallory presents Alice's credential: gate rejects |
| C. Solvency | Editable book; attest with locked reserves for a period, with a countdown; customer checks; auditor opening; release after the period | Insolvent: no proof possible. Second attestation or release inside the period: vault rejects |
Run
- Jar:
cd pedersen-commitments && ./gradlew clean bootJar -PwithFrontend && java --enable-native-access=ALL-UNNAMED -Dzeroj.allowInsecureTrustedSetup=true -jar build/libs/pedersen-commitments-*.jar, then open http://localhost:8093. - Docker:
./demo.sh pedersen [--run]. The image needs a ZeroJ release with ADR-0051, so until then use the jar. - The CLI walkthrough is now
./gradlew walkthrough.
Verified on Yaci DevKit
- Every tab, driven in a browser:
- points: issue, transfer, redeem, overspend (no proof), theft (rejected);
- credential: issue, claim, a threshold above the profile (no proof), Mallory (rejected);
- solvency: insolvent (no proof), attest, checks, audit, second attestation (rejected), release inside the period (rejected), release after the period.
- API: the
demo.sh --runsequence, every call against a fresh jar. - Tests:
./gradlew testandZEROJ_YACI_E2E=true ./gradlew test(three DevKit E2E tests) pass. - Build:
./build-all.sh build -x testpasses for all usecases.
Rejections are the scripts failing in local Julc evaluation of the real transaction, as the node would run them; rejected transactions are not submitted.
🤖 Generated with Claude Code
The demo's prototype ElGamal (JubjubElGamal, JubjubElGamalGadget) is replaced by ZeroJ's elgamal-jubjub-v1 profile from zeroj PR #76: - PrivateBallotProof v3 encrypts with ZkElGamal under a verifier-fixed key (vote @uint(bits=1)); TrusteeShareProof v2 is ZkElGamal's DLEQ relation. New circuit versions, so new setups and scripts; the DLEQ R1CS digest equals the prototype's. - Services use the safe host API: ballots are admitted with a delegated EncryptionStatementVerifier backed by the chain (width, ballot policy, key, ciphertext match), and decryption shares are accepted only as VerifiedDecryptionShare built from verified DLEQ proofs. - ElGamalCompatibilityTest shows the prototype's vectors decrypt identically. - ADR-0005 r4 records the move; zerojVersion pinned to the local snapshot 0.1.0-pre13-8a5078a-SNAPSHOT (zeroj #76 head) until a release. Unit, circuit and Plutus VM tests pass, and the DevKit E2E tallies YES=2, NO=1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
private-voting now uses ZeroJ's
|
| Suite | Tests | Failures | Skipped |
|---|---|---|---|
| private-voting | 16 | 0 | 1 (DevKit E2E, gated by an environment variable) |
| private-voting DevKit E2E | 1 | 0 | 0 |
| pedersen-commitments, with its 3 DevKit E2E tests | 19 | 0 | 0 |
The private-voting election on DevKit tallies YES=2, NO=1.
…ion.properties
The Docker demo images passed -PzerojVersion=${ZEROJ_VERSION}, defaulting to 0.1.0-pre12 in
compose.demo.yml and both Dockerfiles, so ./demo.sh ignored version.properties and built
against an older ZeroJ. The images now copy version.properties and pass -PzerojVersion only
when ZEROJ_VERSION is set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`*.jar` in .gitignore also excluded gradle/wrapper/gradle-wrapper.jar, so on a fresh clone ./gradlew failed in nine modules and ./demo.sh failed inside the Docker build with "Could not find or load main class org.gradle.wrapper.GradleWrapperMain". .gitignore now re-includes gradle-wrapper.jar. The added jar is the official Gradle 9.2.0 wrapper, generated with the 9.2.0 distribution these modules use; its SHA-256 matches services.gradle.org/distributions/gradle-9.2.0-wrapper.jar.sha256: 423cb469ccc0ecc31f0e4e1c309976198ccb734cdcbb7029d4bda0f18f57e8d9 The five modules that already tracked a jar keep the official Gradle 7.5 wrapper (91a23940…), which runs 9.2.0 as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onfidential-notes-m3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # version.properties
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Fixes #7, and adds three new Pedersen commitment use cases. Built against ZeroJ's Pedersen commitment profiles (bloxbean/zeroj#73, ADR-0051) and its
elgamal-jubjub-v1profile (bloxbean/zeroj#76, ADR-0052; this PR is that ADR's milestone M3).1. private-voting: votes are now actually private (#7)
Before, the ballot was
Poseidon(vote, nullifier)with a public nullifier, so anyone could decode every vote, and the tally did exactly that.Now each ballot is an exponential ElGamal encryption on Jubjub,
A = [k]G,B = [v]G + [k]PK. The key is shared n-of-n by three trustees, each of whom proves possession of their share.[k]Gand[k]PK.ΣB − ΣD = [YES]·G.The redesign also closes on-chain binding gaps (ADR-0005 G1–G5):
2. New:
pedersen-commitments/, three demos (ADR-0006)in = out1 + out2;in = change + public price)PointsLedgermulti-validator: issuer-only supply, owner-signed spends, unforgeable one-time receiptsincome ≥ X ∧ score ≥ Yand nothing elseCreditGatePolicy: an issuance record (bound to commitment, schema and holder) is required; the badge goes to the holderΣ ≤ Ris provedSolvencyVault, one script per public attestation period: attest only before the period, release only after it, so all of a period's attestations are locked at the same time and reserves cannot be reused one after anotherThere is a CLI walkthrough,
./gradlew run, plus tests. It has no web UI.Build fixes (2026-10-12)
935bf93: pin ZeroJ0.1.0-pre13, and the Docker demos use it.-PzerojVersion=${ZEROJ_VERSION}, which defaulted to0.1.0-pre12incompose.demo.yml,compose.ymland both Dockerfiles. So./demo.shignoredversion.propertiesand built against an older ZeroJ.version.propertiesand pass-PzerojVersiononly whenZEROJ_VERSIONis set.a809d1d: add the Gradle wrapper jar to the nine modules that lacked it..gitignore's*.jarrule also excludedgradle-wrapper.jar. So on a fresh clone,./gradlewfailed in those modules, and./demo.shfailed withCould not find or load main class org.gradle.wrapper.GradleWrapperMain.423cb469…..gitignorenow re-includesgradle-wrapper.jar../demo.sh proof-of-reserves --clean-cache --runbuilt the image against the0.1.0-pre13jars and minted a solvent attestation on Yaci DevKit.ZEROJ_YACI_E2E=true ./gradlew testinproof-of-reservespassed 61 tests with 0 failures.Testing (local, Yaci DevKit)
v = 2, orAandBfrom differentk;Reviews
Both ADRs and both implementations went through independent adversarial reviews, and the findings are fixed. The fixes include:
Not production-ready (documented)
🤖 Generated with Claude Code