From 2923bb85d89983e779d3bfbcfa2089b0d0d36912 Mon Sep 17 00:00:00 2001 From: fiamma-builder Date: Fri, 15 Nov 2024 10:51:36 +0800 Subject: [PATCH] docs: update readme --- README.md | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 57ebe6b..ba0a749 100644 --- a/README.md +++ b/README.md @@ -53,14 +53,18 @@ cargo build --release ### Explanation of All Command Parameters - `--network`: The network to use. Currently, only `testnet` is supported. - `--private-key`: The signet btc private key for the validator. -- `--validator-key`: The new validator address for the fiamma chain, you can get the validator address refer to https://docs.fiammachain.io/our-product-suite/bitvm-powered-zkp-verification-layer/developer-guides/run-a-fiamma-node/become-a-validator. -- `--txid`: The signet btc transaction ID for the registration process. -- `--vout`: The signet btc output index for the registration process. -- `--proof-id`: The proof ID for the challenge process. +- `--validator-key`: The new validator address for the fiamma chain, you can get the validator address refer to [become a validator](https://docs.fiammachain.io/our-product-suite/bitvm-powered-zkp-verification-layer/developer-guides/run-a-fiamma-node/become-a-validator). +- `--proof-id`: The proof ID for the challenge process, we provide a test proof id `1735e881fa5e58408e4710a4e8cbea0a7995f029eefdf85d7e59775b0b6c44c5` for you to challenge, you can use it to test the challenge process. - `--vk-path`: The path to the verification key for the challenge process, you can get it from the fiamma committee cli repository [vk.bitvm](https://github.com/fiamma-chain/fiamma-committee-cli/blob/main/vk.bitvm). - `--circuit-type`: The circuit type for the challenge process. Currently, only `groth16` is supported. -- `--script-index`: This is the bitvm2 challenge program split script index, this number cannot be modified at present. +- `--script-index`: This is the bitvm2 challenge program split script index, this number is fixed and cannot be modified at present. - `--reward-address`: The reward signet btc address for the disprove process, if you challenge success, you will get the reward. +- `--txid`: The signet btc transaction ID for the registration process. +- `--vout`: The signet btc output index for the registration process. + you can get the txid and vout use the following command: + ```bash + curl -sSL "https://mempool.space/signet/api/address/{signet_btc_address}/utxo" + ``` ### Register as a BitVM2 Staker/Validator @@ -72,14 +76,16 @@ If you want to run a fiamma node as a validator, you first need to register as a fcli register --network testnet start --validator-key --txid --vout --private-key ``` -after executing the above command, you will get a registration number, please wait patiently until the registration is complete. it will take about 10 minutes depending on the bitcoin network. - +after executing the above command, you will get a registration number, the committee will generate some tx and bitvm2 challenge scripts, it will take about 5 minutes. #### 2.Finish the registration process ``` fcli register --network testnet finish --validator-key --private-key ``` +after executing the above command, the register tx will be broadcasted to the bitcoin network, it will take about 10 minutes for the registration to be complete depending on the bitcoin network. + +after the registration is complete, you can become a validator. ### Challenge Proofs If you want to challenge a proof , you can use the following command: @@ -96,12 +102,27 @@ fcli challenge --network testnet start --proof-id --vk-path fcli challenge --network testnet finish --proof-id --vk-path --circuit-type groth16 --txid --vout --private-key ``` -#### 3.Disprove the challenge +#### 3. Monitor the challenge process + +After you execute the challenge finish command, you can monitor the challenge process by the following command: + +``` +fcli challenge --network testnet info --proof-id --vk-path --circuit-type groth16 +``` + +You can see that the console will print out the challenge tx id and committe generated assert tx id and the challenge status +You should use the tx id to query the [signet explorer](https://mempool.space/signet/tx/d81eccdca492ad1c9e9b4e9dd48fb181eb566bed2949d3b8f13d28ff015e489b) to see if the challenge tx and assert tx is confirmed. + +#### 4.Disprove the challenge + +After executing the challenge finish command, if you challenge success, you will get the reward, you can use the following command to create the disprove tx and broadcast it to the bitcoin network: ``` fcli disprove --network testnet create_disprove_tx --proof-id --script-index 977 --reward-address ``` +You should wait until the disprove tx is confirmed, after the disprove tx is confirmed, you will get the reward to your reward address. + ## License This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.