feat(confidential): add compliance clawback - #855
Draft
brozorec wants to merge 1 commit into
Draft
Conversation
Adds the ConfidentialClawback trait: an admin- and auditor-gated seizure of a frozen account's confidential claim, plus a forced revoke that pulls escrowed allowances back into reach of the seize. The Clawback circuit proves knowledge of the openings of C_spend and C_receive and bounds the seize by their sum (CB1-CB3). Post-verification is the merge rule plus a public debit with no fresh randomness, so the seized account stays spendable. Settlement is `None` (pool left over-collateralized) or `Some(d)` (exactly `amount` transferred), with the destination bound into the proof.
Contributor
|
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: trueComment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Stack 3/3. Base:
feat/conf-token-proofless-revoke(#854), which sits onfeat/conf-token-auditor-escrow(#853).What
Adds
ConfidentialClawback: an opt-in, admin- and auditor-gated seizure of a frozen account's confidential claim, plus a forced revoke that pulls escrowed allowances into reach of the seize.circuits/clawback/(51 ACIR opcodes — the cheapest circuit afterRegister) + VKCircuitType::Clawback = 5ConfidentialClawbacktrait,clawbackandforce_revoke_spenderstorage fnsset_commitments(pub(crate)),pub(crate)promotion ofverify/append_*AccountNotFrozen3604,InvalidClawbackAmount3605,InvalidClawbackDestination3606),ClawbackeventThe mechanism
The circuit proves what the contract cannot check itself, since the balances are committed: knowledge of the Pedersen openings of
C_spend(CB1) andC_receive(CB2), and that the seize is bounded by what those openings hold,α ≤ v_s + v_r(CB3).The witness is producible by anyone holding the openings — the auditor, or the owner — and not by the admin, which holds no blinding. That asymmetry is the two-party separation: the compliance authority decides whether, the auditor decides how much and where to.
Post-verification is the merge rule plus a public debit —
C_spend ← C_spend + C_receive − α·G,C_receive ← O— with no fresh randomness. The new opening(v_s + v_r − α, r_s + r_r)is recomputable by both owner and auditor, so the seized account stays spendable. Re-randomizing under an admin-chosen blinding would brick the account permanently._dest_fis an unconstrained public input that binds the settlement destination. Dropping it turns a compromised clawback signer from a griefer into a thief.Clawback = 5reuses the valueRevokeSpendervacated in #854. Admissible only against a verifier registry deployed fresh with an all-new key set.Clawback = 6avoids the hazard at zero cost — recommend changing before merge.Known gaps
circuits/clawback/src/tests.nr(10 tests).ConfidentialClawback: ConfidentialCompliancedoes not force a gatingHooksimpl. A deployment wiringNoHooksgets a freeze that sets the flag while every operation stays ungated — the target can spend out before the seize lands. Documented as a deployment obligation in COMPLIANCE.md §5.3; not enforceable by the trait bound.Checks
nargo test144 passed ·cargo test -p stellar-tokens723 passed ·cargo +nightly fmt --checkclean ·cargo clippy --all-targetsclean ·constraints.baselineregenerated