Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec for speudorandom generation #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions specs/rigil/precompiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down