feat(payment): commitment binding fields for quote types (ADR-0004)#11
Merged
Conversation
Add `committed_key_count` and `commitment_pin` to `PaymentQuote` and `MerklePaymentCandidateNode`, and `commitment_sidecars` to `MerklePaymentProof`. The two fields bind a quote's price to the node's audited storage commitment: they are covered by the quote signature and the quote hash, so the price a node may charge is tied to how much data it can prove it holds. Both signing payloads are extended to cover the new fields (single-node `bytes_for_signing` and the merkle candidate `bytes_to_sign` 5-field form), with the pin tagged (0 = none, 1 = present) so a baseline quote cannot collide with one pinning an all-zero hash. New fields are tail- placed with serde defaults. This is the shared wire-type half of ADR-0003 (commitment-bound quote pricing); the node-side pricing/audit and the client-side resolve-before- pay enforcement live in ant-node and ant-client respectively.
This was referenced Jun 17, 2026
…unning ADR) The commitment-bound quote pricing ADR clashed with Mick's full-node shunning ADR, which also took numbers 0002/0003. Renumber the pricing ADR's references to 0004; no functional change (doc comments only). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ields) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dirvine
approved these changes
Jul 1, 2026
dirvine
left a comment
There was a problem hiding this comment.
Reviewed the current head a7ac7e2620cb6a50151dd0c619fd75e03b02f05c for evmlib #11.
Verified:
Cargo.tomlis bumped to0.9.0for the breaking signed quote/wire-format change.CHANGELOG.mddocuments ADR-0004 and the hard-cutover signature incompatibility.PaymentQuote::bytes_for_signingcoverscommitted_key_countand a taggedcommitment_pin(NonevsSome([0; 32])cannot collide).PaymentQuote::hashcontinues to include the signed payload plus pubkey/signature, so the new binding fields are hash-covered.MerklePaymentCandidateNode::bytes_to_signandto_bytesinclude the same count/pin binding, so Merkle candidate signatures and pool hashes bind the new fields.- Current CI is green: 7/7 checks pass, including dry-run publish.
Local note: cargo test --all --no-fail-fast builds, but Anvil-dependent tests fail locally because anvil is not installed on this runner (SpawnFailed: No such file or directory). Non-Anvil tests that ran passed; GitHub CI has the pinned Foundry setup and is green.
No code issues found in this crate. The remaining blockers from the earlier package review are downstream in ant-protocol/ant-node/ant-client, not in evmlib.
Minor non-blocking nit: the PR body still says ADR-0003 in a few places while the committed files now say ADR-0004.
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.
Part of ADR-0003: commitment-bound quote pricing — the shared wire-type layer.
What
Adds the signed fields that bind a quote's price to the node's audited storage commitment:
PaymentQuoteandMerklePaymentCandidateNodegaincommitted_key_count: u32+commitment_pin: Option<[u8; 32]>(tail-placed, serde-default).MerklePaymentProofgainscommitment_sidecars: Vec<Vec<u8>>.bytes_for_signingand the merkle candidatebytes_to_sign(now 5-field), with the pin tagged (0= none,1= present) so a baseline quote can't collide with one pinning an all-zero hash.The two fields are covered by the quote signature and the quote hash, so the price a node may charge is tied to how much data it can prove it holds.
Scope
This is only the shared struct/signing change. The node-side pricing + audit and the client-side resolve-before-pay enforcement live in the companion PRs:
Release ordering
This is the first crate in the ADR-0003 release chain — it has no ADR-0003 dependencies and builds standalone. The other three depend on it being published.
This is a breaking quote-format change (the signed payload changes), per the ADR's hard-cutover rollout.