Skip to content

Commit

Permalink
docs: update examples in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ppoliani committed Feb 12, 2024
1 parent 4dfd7eb commit c116a10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,21 @@ The zkapp doesn't have to do anything with the `truncated_txid` field (although
You can deploy a stateless zkapp with the following command:

```shell
$ zkbtc deploy-zkapp --circom-circuit-path examples/circuit/stateless.circom --satoshi-amount 1000
$ zkbtc deploy-zkapp --circom-circuit-path examples/circuit/stateless.circom --srs-path ~/.zkbitcoin/srs_16.ptau --satoshi-amount 1000
```

> Use the `--srs-path` where you downloaded the SRS file. Check "Download SRS File" above.
This will lock 1,000 satoshis in the zkapp and return the transaction ID of the transaction that deployed the zkapp. A stateless zkapp can be referenced by that transaction ID.

Bob can then unlock the funds from the stateless zkapp with the following command:

```shell
$ zkbtc use-zkapp --txid "e793bdd8dfdd9912d971790a5f385ad3f1215dce97e25dbefe5449faba632836" --circom-circuit-path examples/circuit/stateless.circom --proof-inputs '{"preimage":["1"]}' --recipient-address "tb1q6nkpv2j9lxrm6h3w4skrny3thswgdcca8cx9k6"
$ zkbtc use-zkapp --txid "e793bdd8dfdd9912d971790a5f385ad3f1215dce97e25dbefe5449faba632836" --circom-circuit-path examples/circuit/stateless.circom --srs-path ~/.zkbitcoin/srs_16.ptau --proof-inputs '{"preimage":["1"]}' --recipient-address "tb1q6nkpv2j9lxrm6h3w4skrny3thswgdcca8cx9k6"
```

> Use the `--srs-path` where you downloaded the SRS file. Check "Download SRS File" above.
### Stateful zkapps

A stateful zkapp is a zkapp that has a state, and which state can be updated without consuming the zkapp.
Expand Down
4 changes: 2 additions & 2 deletions src/bin/zkbtc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ enum Commands {
circom_circuit_path: PathBuf,

/// The path to the srs file
#[arg(short, long)]
#[arg(long)]
srs_path: PathBuf,

/// Optionally, an initial state for stateful zkapps.
Expand Down Expand Up @@ -89,7 +89,7 @@ enum Commands {
circom_circuit_path: PathBuf,

/// The path to the srs file
#[arg(short, long)]
#[arg(long)]
srs_path: PathBuf,

/// A JSON string of the proof inputs.
Expand Down

0 comments on commit c116a10

Please sign in to comment.