Repository navigation
feat(bounty): implement payout-address indirection for anonymity-preserving claims (#238) - #500
Open
umpireboulianne-design wants to merge 1 commit into
Conversation
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.
Summary
Implements anonymity-preserving payout-address indirection on
RefractBountyEscrowso researchers can claim bounties without permanently linking their disclosure identity to their payout wallet on-chain.Closes #238
Changes
bounty/src/lib.rs):compute_commitment(preimage): computesSHA-256(preimage)for 32-byte secret preimages.submit_disclosure(submitter, report_hash, commitment): binds a vulnerability disclosurereport_hashto a payoutcommitmentinstead of the submitter's funding address, rejecting duplicate reports and commitment reuse across reports (BountyError::CommitmentAlreadyUsed).award_commitment(caller, report_hash, commitment, amount): governance-gated entrypoint that adjudicates a report against itscommitmentand reservesamountin theCommitmentAwardStatus::Awardedstate without exposing the destination wallet.bounty/src/lib.rs):register_payout_address(owner, preimage, payout_address): requirespreimageat registration to prevent front-running, storesPayoutBindingRecordin persistent storage with explicit TTL extension (extend_ttl) and bounded lifetime (DEFAULT_BINDING_TTL_SECS), and emitsp_reg.rotate_payout_address(owner, preimage, new_payout_address): allows the binding owner to rotate the payout destination prior to claim, atomically revoking the previous payout address so two addresses can never claim the same award, and emitsp_rotate.bounty/src/lib.rs):claim_by_commitment(caller, preimage): verifies the preimage, checks binding ownership/TTL/freeze state, transitions the award fromAwardedtoClaimed, releases the reservation, transfers the reward to the boundpayout_address, and emitsc_claim.freeze_payout_address(caller, address, frozen): governance-gated entrypoint to freeze or unfreeze a compromised payout address without altering the awarded reward amount (allowing the binding owner to rotate to a clean address before claiming). By design, lost keys/preimages are an unrecoverable loss with no admin redirect override.SECURITY.md,bounty/src/lib.rs):SECURITY.mdand the crate-level rustdoc.bounty/src/test.rs):indirection_register_award_rotate_claim_happy_pathindirection_double_claim_rejectedindirection_commitment_reuse_rejectedindirection_claim_with_wrong_preimage_rejectedindirection_rotation_by_non_owner_rejectedindirection_binding_ttl_expiry_rejectedindirection_freeze_compromised_payout_address_preserves_reward_and_allows_rotationChecklist
unwrap(),expect(), orpanic!()calls in non-test contract codeSECURITY.mdand crate documentation updated