Repository navigation
feat(contracts)!: key the claims vault by the nullifier - #319
Draft
nicolasLuduena wants to merge 6 commits into
Draft
nicolasLuduena wants to merge 6 commits into
nicolasLuduena wants to merge 6 commits into
Conversation
verifyAttestation stores the claim under its nullifier and rejects a nullifier already in the vault, so vault membership is the replay check. The nullifier set, the claim id and the commitment randomness in the witness are gone. openClaim takes the nullifier and returns the observation identity, the fields the nullifier binds, without holder or version.
ADR 0016 records why the vault key hides no more and no less than the nullifier the same transaction publishes, including for a chain-event kind whose salt is public. The glossary, the root README, the design and the kind author guide open a claim by its nullifier.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…tection List what openClaim rejects apart from what the module leaves to the app, show where the Cardano guide's nullifier comes from, and drop the bytes mock's unused Observation export.
…d-vault # Conflicts: # packages/contracts/README.md
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #312
Part of #309. This is PR 4 of 6, stacked on #318.
Summary
The claims vault is keyed by the nullifier. Vault membership is the replay check. The nullifier set, the claim id (
persistentCommit(claim, rand)) and the commitment randomness are gone.openClaimtakes the nullifier and returns the observation identity. The vault entry and the vault pseudonym do not change.The holder computes the nullifier off-chain with
nullifierOf(claim)from@txpipe/thoth-core/claim. Neither kind keeps vault state now. Each kind'sgetAttestationWitnessreturns[claim, signatures], and both acceptance tests open the accepted claim by its off-chain nullifier.Evidence
Before is
feat/311-holder-one-block; after is this branch. Both come fromnpm run bench: Ryzen 7 5700G, proof server 9.0.0, a fresh container per circuit, 3 warm proofs.verifyAttestationis at most 16,384 on both mocks (the bytes mock has 785 rows to spare), and the three open circuits are at most 8,192. The open circuits prove with the unchangedhashToCurvepseudonym.openAndReadBytesstays atk = 15. Reassembling the byte halves is what contracts, core: byte slots travel whole #313 removes.A predicate that reads
holderorversionfromopenClaim's result does not compile. I compiled this throwaway mock, then deleted it:The same mock reading
c.saltinstead compiles (exit 0). The returned type says the same thing, andnpm run typeschecks it:I checked that this test fails when
'holder'is dropped from theOmit.Simulator tests on the numeric mock (
attestation.test.ts):Both acceptance suites (
acceptance.test.tsfor zkFetch,acceptance-cardano.test.tsfor Cardano) gainlets the holder open the accepted claim by its off-chain nullifier, and both pass.npm testpasses (823 passed, 4 live tests skipped), and so donpm run typesandnpm run check.No verification skill in this repo.
Merge Danger
Door: two-way
Pre-launch, nothing is deployed. The vault key and the witness shape can still change, and
versionstays1.Blast Radius: contract-wide
Every embedding contract changes:
A_nullifiersandcomputeIdare gone.getAttestationWitnessreturns two elements instead of three.Observationinstead of aClaim.A predicate that read
holderorversionstops compiling, which is the point of the change.