Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevincharm/randao-accessor
Access historical prevrandao values onchain
https://github.com/kevincharm/randao-accessor
ethereum randao rlp solidity
Last synced: about 5 hours ago
JSON representation
Access historical prevrandao values onchain
- Host: GitHub
- URL: https://github.com/kevincharm/randao-accessor
- Owner: kevincharm
- License: mit
- Created: 2023-07-15T18:23:59.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-15T18:24:11.000Z (over 1 year ago)
- Last Synced: 2024-04-14T13:46:02.378Z (7 months ago)
- Topics: ethereum, randao, rlp, solidity
- Language: Solidity
- Homepage:
- Size: 191 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
```diff
- THIS CODEBASE HAS NOT BEEN AUDITED
```# Randao Accessor
Access historical `prevrandao` values onchain by submitting RLP-encoded block headers and validating them against block hashes. When accessing blocks older than the previous 256 blocks, extra witness data is required to validate against [Axiom's block hash cache](https://docs.axiom.xyz/developers/reading-historic-block-data).
## Generating inputs
To generate RLP-encoded block headers, you'll need access to an Ethereum execution RPC. See the `getBlockWithRLP` function in `test/util/rlp.ts` for an example of how to fetch block data and how to encode the data into RLP format.
A witness can be generated using the [Axiom SDK](https://www.npmjs.com/package/@axiom-crypto/core) when accessing older blocks. See [Reading Historic Block Data](https://docs.axiom.xyz/developers/reading-historic-block-data) for more information.