diff --git a/EIPS/eip-4844.md b/EIPS/eip-4844.md index 9fac2b8fe16dee..5593232713e4b4 100644 --- a/EIPS/eip-4844.md +++ b/EIPS/eip-4844.md @@ -344,6 +344,8 @@ class BlobTransactionNetworkWrapper(Container): tx: SignedBlobTransaction # KZGCommitment = Bytes48 blob_kzgs: List[KZGCommitment, MAX_TX_WRAP_KZG_COMMITMENTS] + # KZGProofs = Bytes48 + blob_proofs: List[KZGProof, MAX_TX_WRAP_KZG_COMMITMENTS] # BLSFieldElement = uint256 blobs: List[Vector[BLSFieldElement, FIELD_ELEMENTS_PER_BLOB], LIMIT_BLOBS_PER_TX] ``` @@ -355,10 +357,19 @@ def validate_blob_transaction_wrapper(wrapper: BlobTransactionNetworkWrapper): versioned_hashes = wrapper.tx.message.blob_versioned_hashes commitments = wrapper.blob_kzgs blobs = wrapper.blobs - assert len(versioned_hashes) == len(commitments) == len(blobs) - for versioned_hash, commitment, blob in zip(versioned_hashes, commitments, blobs): + proofs = wrapper.blob_proofs + + assert len(versioned_hashes) == len(commitments) == len(blobs) == len(proofs) + for versioned_hash, commitment, blob, proof in zip(versioned_hashes, commitments, blobs, proofs): # note: assert blob is not malformatted - assert commitment == blob_to_kzg(blob) + + # Get `x` point using Fiat-Shamir + x = hash_to_bls_field(commitment) + # Evaluate blob polynomial at `x` + y = evaluate_polynomial_in_evaluation_form(blob, x) + # Check that blob polynomial matches the `commitment` by verifying provided proof + assert verify_kzg_proof(commitment, x, y, proof) + # Finally check that the `versioned_hash` matches the `commitment` assert versioned_hash == kzg_to_versioned_hash(commitment) ```