Skip to content

Commit 29cbed9

Browse files
committed
Update README
1 parent 422dae8 commit 29cbed9

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

README.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,34 @@ The script uses fixed signature data (tests/sphincsplus/test_data/), Because dif
3434

3535
* Note: Default hash type: **shake-128f-simple** (Verify cycles: about 70M)
3636

37-
## Sample
38-
39-
```shell
40-
tx init --tx-file tx.json
41-
wallet get-capacity --address ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqfkmqr3ry0crq4w88n86mk4h99am3dlldsuydg36
42-
wallet get-live-cells --address ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqfkmqr3ry0crq4w88n86mk4h99am3dlldsuydg36
43-
tx add-input --tx-hash 0x1ff88a5f9cb719abd86978b05c39d82fd83473519272013afdbee20d5c7ff162 --index 1 --tx-file tx.json
44-
tx add-output --to-sighash-address ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqfkmqr3ry0crq4w88n86mk4h99am3dlldsuydg36 --capacity 15096.20139385 --tx-file tx.json
45-
```
37+
## Sample in Dev Blockchain
38+
**Convert a default Lock to ckb-sphincsplus lock script (in ckb dev)**
39+
40+
1. compile. Hera we use the default options.
41+
</br>
42+
Here we will get a sphincsplus_lock file, the size is about 85608bytes.
43+
2. Deploy the compiled contract to the test network.
44+
</br>
45+
We use [ckb-cli](https://github.com/nervosnetwork/ckb-cli) to deploy this contract, You can refer to [here](https://github.com/nervosnetwork/ckb-cli/wiki/Handle-Complex-Transaction#a-demo).
46+
* After the execution is successful, it is recommended to record the tx-hash to facilitate subsequent operations.
47+
3. Generate key file.
48+
</br>
49+
Use this tool: tools/ckb-sphincs-tools.
50+
``` shell
51+
cargo run -- gen-key key.json
52+
```
53+
We can get a set of key files, including public and private keys.
54+
* If the contract you compile does not use the default value, it needs to be the same here.
55+
* Need to save this file.
56+
4. Convert a secp256k1 default lock script to SPHINCS+ lock script.
57+
``` shell
58+
cargo run -- cc_to_sphincsplus --tx_hash <tx-hash> --tx_index <index> --key_file key.json --prikey <You can use ckb-cli account export>
59+
```
60+
5. Convert a SPHINCS+ lock script to secp256k1 default lock script.
61+
``` shell
62+
cargo run -- cc_to_sphincsplus --tx_hash <tx-hash> --tx_index <index> --key_file key.json --lock_arg <LOCK-ARG> --sp_tx_hash <SPHINCS+ Script in step 2> --sp_tx_index <index>
63+
```
64+
65+
66+
## Sample in Testnet
67+
TODO

0 commit comments

Comments
 (0)