Repository navigation
feat(contracts,core)!: hash the holder commitment in one SHA-256 block - #318
Draft
nicolasLuduena wants to merge 6 commits into
Draft
nicolasLuduena wants to merge 6 commits into
nicolasLuduena wants to merge 6 commits into
Conversation
The commitment is SHA-256 of the 22-byte tag thoth:holder-commit:v1, then the secret: 54 bytes, one block instead of two. A test pins it to a plain SHA-256 and checks the core mirror against the circuit over seeded random secrets.
|
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. |
…nt docs Seed the pseudonym separation test from THOTH_SEED so a failure replays.
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 #311
Part of #309
PR 3 of 6, stacked on #317.
Summary
The holder commitment fits one SHA-256 block. It used to hash a 32-byte padded tag and the secret, 64 bytes over two blocks. It now hashes a 22-byte tag and the secret, 54 bytes in one block, which saves 1,854 rows in
verifyAttestation.The vault pseudonym (
deriveHolder,hashToCurveoverthoth:holder:v1) does not change, so one secret still gives unrelated values in the two roles. The vault, the claim id, byte slots and the signature check are untouched.Evidence
holder-parity.test.tsproperty ("a plain SHA-256 of the tag then the secret, in one block") failed against the old circuit.After: it passes for 202 secrets (all zeros, all
0xff, 200 seeded random ones), and so does the core-vs-circuit parity over the same secrets. The existingrejects a caller who does not know the signed holder secrettest still throwsHolder mismatch.npm testpasses (821 passed, 4 skipped), and so donpm run typesandnpm run check.npm run bench(Ryzen 7 5700G, proof server 9.0.0, 3 warm runs). Every circuit of both mocks proved, every proof verified against its verifier key, and the server refused the wrong-key control.kdoes not change yet; #312 to #314 bringverifyAttestationtok = 14. The contracts README table is regenerated from this run.No verification skill in this repo.
Merge Danger
Door: two-way
Pre-launch, nothing is deployed. Reverting restores the old tag.
Blast Radius: holders
Every holder commitment changes value. A claim built with an older
@txpipe/thoth-corefailsHolder mismatchagainst a contract from this release. Changesets forcoreandcontractssay so.