-
Notifications
You must be signed in to change notification settings - Fork 29
Add hinted P-384 Nitro attestation verification for Fusaka #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
915fdb0
init
leanthebean ed580ad
happy path & doc updates
leanthebean 85fcae6
Merge remote-tracking branch 'origin/main' into hinted_p384
leanthebean ceee719
Make hinted P-384 branch self-contained and review-ready
leanthebean 1206e84
Document behavioral gaps, add parser tests, version as v2.0.0-rc.1
leanthebean 14b72b6
docs: sync feature doc with current code
leanthebean 86ddb84
docs: add plain-language "Intuition" section to the feature doc
leanthebean 04a76fb
docs: emphasize the ~384-bit exponent and add per-signature hint table
leanthebean 10e9a06
docs: condense "Preparing calls off-chain" section
leanthebean 4bb60c3
Address hinted P-384 review feedback
leanthebean edaad2f
Update hinted Nitro size table
leanthebean File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| BASE_SEPOLIA_RPC_URL=https://sepolia.base.org | ||
| PRIVATE_KEY= | ||
|
|
||
| # Demo-only: lets the January 2026 fixture pass certificate expiry checks on a | ||
| # June 2026 Base Sepolia block. Production-named contracts keep zero grace. | ||
| DEMO_CERT_EXPIRY_GRACE_SECONDS=31536000 | ||
|
|
||
| # Uses the repaired real attestation fixture embedded in the script. | ||
| USE_BUNDLED_REAL_ATTESTATION=true |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| [submodule "lib/forge-std"] | ||
| path = lib/forge-std | ||
| url = https://github.com/foundry-rs/forge-std | ||
| [submodule "lib/solidity-lib"] | ||
| path = lib/solidity-lib | ||
| url = https://github.com/dl-solarity/solidity-lib |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project are documented here. The format is based on | ||
| [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project aims to follow | ||
| [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [2.0.0-rc.1] - 2026-06-09 | ||
|
|
||
| First release candidate of the **hinted P-384** rework. This is a major, breaking change motivated | ||
| by the Fusaka upgrade (EIP-7883), which raises `MODEXP` pricing enough that the previous fully | ||
| on-chain attestation verification no longer fits in a block on Base. Verification now moves the | ||
| modular inversions off-chain as calldata "hints" that are re-verified on-chain (`b · inv ≡ 1 mod m`), | ||
| so a wrong hint can only revert, never forge — the accept rule is unchanged. | ||
|
|
||
| This is a release candidate: it is intended for the human security audit and partner evaluation, not | ||
| yet a general-availability release. | ||
|
|
||
| ### Changed (breaking) | ||
| - Verification is now hinted. Use `CertManager.verifyCACertWithHints` / | ||
| `verifyClientCertWithHints` and `NitroValidator.validateAttestationWithHints`. | ||
| - Constructors now take an `IP384Verifier`: deploy `P384Verifier` → `CertManager(p384Verifier)` → | ||
| `NitroValidator(certManager, p384Verifier)`. | ||
| - `validateAttestationWithHints` requires the certificate bundle to be verified/cached first; an | ||
| uncached bundle reverts with `"inverse hint underflow"`. | ||
|
|
||
| ### Removed | ||
| - The fully on-chain (non-hinted) verification path. `verifyCACert`, `verifyClientCert`, and | ||
| `validateAttestation` are retained only as reverting stubs (marked deprecated) for ABI continuity. | ||
|
|
||
| ### Added | ||
| - `IP384Verifier` / `P384Verifier` (swappable hinted P-384 verifier) and `ECDSA384Curve` params. | ||
| - Off-chain hint generator and tooling under `tools/` (Node.js, no dependencies), cross-checked for | ||
| byte-identical parity with the on-chain reference via FFI tests. | ||
| - `docs/hinted-p384-nitro-attestation.md` design/security/gas spec. | ||
| - CI job running the FFI hint-parity tests. | ||
| - Negative tests: expired cert (cold & cached), validity boundary, out-of-range scalar rejection; | ||
| and malformed-input / fuzz tests for the DER, CBOR, and byte-slicing parsers. | ||
|
|
||
| ### Internal / hygiene | ||
| - Vendored the P-384 verifier (`src/vendor/ECDSA384.sol`, `MemoryUtils.sol`) from | ||
| `dl-solarity/solidity-lib`, removing the personal-fork submodule; provenance and the exact | ||
| upstream diff are recorded in `src/vendor/`. | ||
| - Documented integrator responsibilities (freshness/replay, signature malleability, enclave policy) | ||
| in NatSpec, the README, and the design doc. | ||
| - Moved the demo `CertManagerDemo` out of `src/` into `test/helpers/`. | ||
|
|
||
| [2.0.0-rc.1]: https://github.com/base/nitro-validator/releases/tag/v2.0.0-rc.1 |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.