This repository contains two tools:
clia command-line tool that lets you interact with WORM by running different subcommands. You can create proofs on your own machine...serverhelps you run a WORM miner server that other people can use to generate proof and submit proof and you will get fees.
First you need rust toolchain:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
In the second step you need to install the nlohmann-json3-dev libgmp3-dev nasm packages:
sudo apt-get update
sudo apt-get install nlohmann-json3-dev libgmp3-dev nasm
cargo build --bin cli
You can find you binary in target/release/cli
cargo build --bin server
You can find you binary in target/release/server
Note: If you want to deploy with Docker, check out this
worm-miner burn --network sepolia/anvil/mainnet --private-key 0x --amount 1.0 --reveal 0.5 --broadcaster-fee 0.1 --sell-on-uniswap 0.1 --receiver-address 0x.. --prover-fee 0.01
--network: Optional (Default:mainnet)--private-key: Required (the private key of the account performing the burn)--amount: Required (The amount we want to send to the burn-address)--reveal: Optional (Default: maximum, same as--amount) (You can partially reveal the burned amount as BETH and encrypt the rest in a note file)--broadcaster-fee: Optional (Default: 0)--sell-on-uniswap: Optional (Default: 0) Part of the reveal amount can be sold in exchange of ETH--receiver_address: Required (Address) user will get BETH on this address--prover-fee: Default is0in case you want to prove it yourself
The burn info (Burn-key, amount etc.) is stored in burn.json in case of failure.
The remaining coin (--amount - --reveal) will be saved as a note in a JSON file.
Minting BETH
worm-miner mint --broadcaster 0x1234... burn.json
--broadcaster: Required (can be a HTTP endpointhttps://prover-1.worm.cx(If we want someone else to broadcast for us, see the Relay section) or a private key0x...(If we want to broadcast ourself with another private key))
- Spend
- Participate
- Claim
Spins up a HTTP server, generates proofs and broadcasts them on behalf of others.
- GET
/proofreturns minimum proving fee of the relayer. - POST
/proofaccepts proof-of-burn zk circuit inputs and starts proof generation - GET
/proof/{nullifier}gets cached proof for the given nullifier. - GET
/relayreturns minimum broadcasting fee of the relayer - POST
/relaygets inputs of amintCoin()transaction and submits on behalf of you.
Note: The first time you run server binary it will create a configuration file at ~/.worm-miner/server_config.json:
{
"min_prover_fee": "0.001",
"min_broadcaster_fee": "0.001",
"private_key": "0x12345678...",
"port": 8080
}This private key is used to sign proof submission transactions and will collect all fees (prover-fee and broadcaster-fee)