Skip to content

Commit 988343c

Browse files
CopilotSteake
andcommitted
Add security documentation for VRF verification
- Documented why VRF verification without direct key validation is secure - Explained the cryptographic binding between VRF proof and public key - Clarified that block signature validation complements VRF security - Security relies on: ECVRF proof binding, deterministic derivation, and block signatures Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
1 parent 8c76591 commit 988343c

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

  • crates/bitcell-crypto/src

crates/bitcell-crypto/src/vrf.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,24 @@ pub struct VrfProof {
4545

4646
impl VrfProof {
4747
/// Verify the VRF proof and recover the output
48+
///
49+
/// # Security Note
50+
/// The public_key parameter is the secp256k1 public key of the block proposer.
51+
/// The VRF uses a different curve (Ristretto255), so we cannot directly validate
52+
/// that the VRF public key was derived from this secp256k1 key.
53+
///
54+
/// However, this is secure because:
55+
/// 1. The ECVRF proof cryptographically binds the output to the VRF public key
56+
/// 2. Only someone with the VRF secret key could generate a valid proof
57+
/// 3. The block signature (validated separately) ensures the proposer has the secp256k1 key
58+
/// 4. The VRF secret key is deterministically derived from the secp256k1 secret key
59+
///
60+
/// Therefore, only the legitimate key holder can produce both a valid block signature
61+
/// and a valid VRF proof.
4862
pub fn verify(&self, _public_key: &PublicKey, message: &[u8]) -> Result<VrfOutput> {
4963
// The VRF public key is embedded in the proof.
5064
// The ECVRF verification ensures that only someone with the corresponding
5165
// secret key could have generated this proof.
52-
// We trust that the block proposer used their derived VRF key correctly.
5366

5467
// Verify the ECVRF proof
5568
let ecvrf_output = self.ecvrf_proof.verify(&self.vrf_public_key, message)?;

0 commit comments

Comments
 (0)