To send bids to provider nodes, the bidder nodes need to prepay the amount to the bidder registry. Funds are locked for each unique bid till the settlement chain settles the commitments. If the bid that was preconfirmed by a provider ends up in the L1 block built by the provider node, we settle the rewards from this amount. If the bid was preconfirmed by a provider which did not build the L1 block, the amount is refunded. If the bid was preconfirmed by a provider who built the block, but the transaction in the bid is not included in the L1 block, the amount is refunded back to the bidder’s balance.
Bidders can withdraw this balance at any point by interacting with the settlement chain. In order to check or prepay, the user needs to interact with the bidder API.
-
Check the allowance
> curl localhost:13523/v1/bidder/get_allowance | jq { "amount": "0" }
In order to add funds to your allowance, we need to first add funds to the Ethereum wallet created for the node.
-
Get the Ethereum wallet address of the node
> curl localhost:13523/topology | jq { "self": { "Addresses": [ "/ip4/127.0.0.1/tcp/13522", "/ip4/172.29.0.4/tcp/13522" ], **"Ethereum Address": "0xB9286CB4782E43A202BfD426AbB72c8cb34f886c"**, "Peer Type": "bidder", "Underlay": "16Uiu2HAmDWZb4DxZQkS9yseXNukBFe6MhZdimSKuZcHFeJrF3jC9" }, "connected_peers": { "providers": [ "0x48ddc642514370bdafad81c91e23759b0302c915", "0x972eb4fc3c457da4c957306be7fa1976bb8f39a6", "0xa1e8fdb3bb6a0db7aa5db49a3512b01671686dcb" ] }, "blocked_peers": null }
-
Add funds to the account. Currently for the testnet, you can use the Primev account to get some testnet ETH. This can be done using the cast command:
> cast send --rpc-url <https://rpc.mev-commit-chain.xyz> \\ --private-key 0x7c9bf0f015874594d321c1c01ada3166c3509bbd91f76f9e4d7380c2df269c55 \\ $ADDRESS \\ --value 100ether
This command will transfer 100 ETH to your
$ADDRESSwhich should be enough to get started.
-
-
Check the minimum amount that can be added to the allowance. Providers will only authorize bids if the bidder has funds greater than the minimum allowance. The amount is in
wei> curl localhost:13523/v1/bidder/get_min_allowance | jq { "amount": "1000000000000000000" }
-
Add allowance
> curl -X POST localhost/v1/bidder/provide_allowance/10000000000000000000 | jq { "amount": "10000000000000000000" }
Once the allowance is added, the bidder can start sending bids and receiving preconfirmations.