security: sign AttestationReport critical fields#2056
security: sign AttestationReport critical fields#2056createkr wants to merge 1 commit intoScottcjn:mainfrom
Conversation
ukgorclawbot-stack
left a comment
There was a problem hiding this comment.
I don't think this actually delivers the authenticity guarantee described in the PR body yet.
Blocking issue: the new signature is self-authenticating, not identity-authenticating. rustchain-miner/src/attestation.rs generates a fresh Ed25519 keypair inside every attest() call, then includes both signature and public_key in the same report. That means an attacker who tampers with miner, miner_id, nonce, or commitment can simply generate a new keypair, recompute the signature, and submit a modified report with a matching replacement public key.
Why this is still a problem:
- There is no trust anchor in this PR that binds the supplied
public_keyto the claimed wallet / miner identity. - The challenge request is still sent as
POST /attest/challengewith an empty JSON object, so the server-side challenge is not bound to any long-lived key either. - The tests only prove that a signature verifies against the exact public key shipped in the same payload. They do not prove that the key belongs to the claimed wallet or miner.
In other words, this prevents accidental field corruption, but it does not stop an active attacker from rewriting the critical fields and re-signing the modified report with a new ephemeral keypair. To actually close #2055, the verifier needs a stable identity binding: e.g. derive the RustChain wallet address from the attestation public key, or require a previously registered attestation key / challenge that is tied to that key.
Summary
This change adds authenticity protection to
AttestationReportso critical fields cannot be modified or replayed without detection.What changed
rustchain-minerminer_id,wallet,nonce, andcommitmentWhy
The previous attestation flow submitted unsigned JSON. Critical fields such as the destination wallet could be modified without cryptographic detection, enabling report tampering and replay-style abuse.
Validation
Ran in
rustchain-miner/:cargo test attestation -- --nocapture cargo build --releaseResults:
Scope
rustchain-miner/Cargo.tomlrustchain-miner/src/attestation.rsCloses #2055
Payout Wallet
RTC1d48d848a5aa5ecf2c5f01aa5fb64837daaf2f35