Skip to content

security: reject replayed MiningProof nonces#2058

Open
createkr wants to merge 1 commit intoScottcjn:mainfrom
createkr:sec/issue2057-miningproof-nonce-replay
Open

security: reject replayed MiningProof nonces#2058
createkr wants to merge 1 commit intoScottcjn:mainfrom
createkr:sec/issue2057-miningproof-nonce-replay

Conversation

@createkr
Copy link
Copy Markdown
Contributor

@createkr createkr commented Apr 4, 2026

Summary

This change hardens Proof of Antiquity validation by rejecting replayed MiningProof nonces across block boundaries.

What changed

  • Added per-wallet nonce tracking in ProofOfAntiquity
  • Rejected reused nonces in submit_proof() with a dedicated NonceReuse error
  • Preserved nonce history across block resets so the same nonce cannot be replayed in a later block
  • Added focused tests covering nonce replay rejection and cross-block persistence

Why

The previous implementation accepted proofs without checking whether a wallet had already used the supplied nonce. Because pending proof state is cleared between blocks, the same proof nonce could be replayed in later blocks and accepted again.

Scope

  • rips/src/proof_of_antiquity.rs only

Closes #2057

Payout Wallet

RTC1d48d848a5aa5ecf2c5f01aa5fb64837daaf2f35

@github-actions github-actions bot added the BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) label Apr 4, 2026
@github-actions github-actions bot added the size/M PR: 51-200 lines label Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) size/M PR: 51-200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: MiningProof nonce replay allows proof reuse across blocks

1 participant