Specify custom compute over the history of Ethereum in Javascript.

You can use AxiomREPL to write a custom query into Axiom and integrate it into your web frontend. These custom circuits can include data queries and arbitrary computation on top of these data queries. The circuit is proven in-browser and can then be sent on-chain to the Axiom V2 prover, which will aggregate the user-supplied compute proof with proofs of the data queries. Once the aggregated proof is posted on-chain, the results of the compute proof are passed to a user-specified callback function for consumption.

AxiomREPL has been tested and works as expected in Google Chrome and Safari. AxiomREPL currently does not work in Firefox


Here is an example to trustlessly prove the block number at which your account made its first transaction.

Circuit Input:

    "address": "0x897dDbe14c9C7736EbfDC58461355697FbF70048",
    "claimedBlockNumber": 9173677

AxiomREPL code:

// example AxiomREPL circuit to prove the first block an account transacted

// get the previous block number
const prevBlock = sub(claimedBlockNumber, constant(1));

//get the account at the previous block
const accountPrevBlock = getAccount(prevBlock, address);

// get the account nonce at the previous block and assert that it is 0
const prevNonce = accountPrevBlock.nonce().toCircuitValue();
checkEqual(prevNonce, constant(0))

// get the account nonce at the claimed block number
const account = getAccount(claimedBlockNumber, address);
const nonce = account.nonce().toCircuitValue();

//checks that nonce > 0 at the claimed block
checkLessThan(constant(0), nonce)

// add the address and blockNumber to the callback, for it to be passed
// as a result to the callback client contract

Replace the input address with your own address and claimedBlockNumber to the first block you made a transaction to prove your account age! Notice that if you supply the wrong claimedBlockNumber, the circuit will fail run. See AxiomREPL Reference for complete documentation about the functions available in AxiomREPL.

Last updated