From a06b6a7f77a565708c621756f17e1dea9e6f3ea3 Mon Sep 17 00:00:00 2001 From: Andrew Miller Date: Tue, 31 Oct 2023 09:01:16 -0500 Subject: [PATCH] spec for speudorandom genreation --- specs/rigil/precompiles.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/specs/rigil/precompiles.md b/specs/rigil/precompiles.md index dc7ae1e..292b19b 100644 --- a/specs/rigil/precompiles.md +++ b/specs/rigil/precompiles.md @@ -182,18 +182,33 @@ Constructs an Ethereum block based on the provided `bidIds`. The construction fo function buildEthBlock(BuildBlockArgs memory blockArgs, BidId bidId, string memory namespace) ``` -### `SubmitEthBlockBidToRelay` +### `pseudorandomBytes` TODO: 🔗 Implementation -Address: `0x0000000000000000000000000000000042100002` +Address: `0x0000000000000000000000000000000040100002` -Submits a given builderBid to a mev-boost relay. Outputs any errors that arise during submission. +Generates pseudorandom bytes associated with the contract, derived from the currently active newtork master key `msk`. + +More specifically it generates a stream of blocks up to `len` size, where each block `i` is computed as `sha3(abi.encode(mpk, msg.sender, x, i))`. In this way the `x` is for domain separation, `i` is for counting, and `msg.sender` provides domain separation at the contract level. + +```solidity +function pseudorandomBytes(bytes32 memory x, uint len) returns (bytes); +``` + +### `SignEthTransaction` + +TODO: 🔗 Implementation + +Address: `0x0000000000000000000000000000000040100001` + +Signs an Ethereum Transaction, 1559 or Legacy, and returns raw signed transaction bytes. `txn` is binary encoding of the transaction. `signingKey` is hex encoded string of the ECDSA private key *without the 0x prefix*. `chainId` is a hex encoded string *with 0x prefix*. ```solidity -function submitEthBlockBidToRelay(string memory relayUrl, bytes memory builderBid) +function signEthTransaction(bytes memory txn, string memory chainId, string memory signingKey) view returns (bytes memory) ``` + ### `SignEthTransaction` TODO: 🔗 Implementation