diff --git a/BEPs/BEP-466.md b/BEPs/BEP-466.md index 81b6bdcd..72fc48f5 100644 --- a/BEPs/BEP-466.md +++ b/BEPs/BEP-466.md @@ -27,17 +27,24 @@ The goal is to make the block format compatible with EIP-7685. This allows for s ## Specification -### Block Body - -Define `requests` as an empty array: +### Requests +A `requests` object consists of a `request_type` prepended to an opaque byte array `request_data`. ```golang -requests = make(types.Requests, 0) +requests = request_type ++ request_data ``` +Each request type will defines its own `requests` object using with its own `request_data` format. ### Block Header -In accordance with EIP-7685, add `requests_hash` to the end of the block header: +In accordance with EIP-7685, add a new 32 byte value `requests_hash` to the end of the block header: ```golang +def compute_requests_hash(requests): + m = sha256() + for r in requests: + m.update(sha256(r)) + return m.digest() + +requests = make(types.Requests, 0) // empty request for BSC block.header.requests_hash = compute_requests_hash(requests) ``` When calculating the header signature, ensure that requests_hash is included in the computation.