@tokamak-private-dapps/private-state-cli 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -1
- package/README.md +95 -62
- package/assets/tx-fees.json +16 -16
- package/cli-assistant.html +35 -35
- package/lib/private-state-cli-command-registry.mjs +116 -34
- package/lib/private-state-runtime-management.mjs +2 -2
- package/package.json +2 -1
- package/private-state-bridge-cli.mjs +674 -203
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 1.1.0 - 2026-05-06
|
|
4
|
+
|
|
5
|
+
- Refreshed channel workspaces through the existing recovery-indexed replay path after successful
|
|
6
|
+
wallet transactions instead of manually patching local snapshots, and bounded post-transaction
|
|
7
|
+
replay by the transaction receipt block so provider latest-block lag cannot skip the confirmed
|
|
8
|
+
transaction logs. This prevents stale `recoveryRootVectorHash` / `recoveryLastScannedBlock`
|
|
9
|
+
metadata after local state changes.
|
|
10
|
+
- Reported `usedWorkspaceCache` and `recoveredWorkspace` from channel vault move commands so
|
|
11
|
+
automated tests can verify that follow-up wallet transactions do not replay workspace recovery
|
|
12
|
+
when the local workspace is already current.
|
|
13
|
+
- Removed the local wallet folder and canonical wallet secret after successful `channel exit`, and
|
|
14
|
+
made `wallet recover-workspace` delete stale local wallet folders and canonical wallet secrets
|
|
15
|
+
when the corresponding L1 account is no longer registered on-chain.
|
|
16
|
+
- Improved `channel join` stale-wallet guidance. The command still does not delete stale wallets
|
|
17
|
+
itself; it tells users to run `wallet recover-workspace` first, and it overwrites the canonical
|
|
18
|
+
wallet secret from the provided `--wallet-secret-path` whenever a new local wallet is allowed.
|
|
19
|
+
- Normalized account command JSON `action` labels and CLI e2e helper names to the current
|
|
20
|
+
`account`, `channel`, and `wallet` command taxonomy.
|
|
21
|
+
- Added `wallet export` and `wallet import` for ZIP-based local wallet backup and restore.
|
|
22
|
+
The default export includes the encrypted wallet, wallet metadata, and wallet-local secret so
|
|
23
|
+
an imported wallet can be used after `channel recover-workspace`. Tracked notes remain preserved
|
|
24
|
+
because they live inside encrypted `wallet.json`; `--include-notes` also includes the channel
|
|
25
|
+
workspace cache needed to use wallet commands immediately when that cache is still chain-aligned.
|
|
26
|
+
- Hardened `wallet import` error handling for invalid ZIP or manifest data and staged imported
|
|
27
|
+
files in a temporary directory before committing them into the CLI data root.
|
|
28
|
+
- Kept account secrets out of wallet exports. Wallet commands restore their signer from the
|
|
29
|
+
encrypted `wallet.json`, while account secrets remain scoped to account-level bridge-vault
|
|
30
|
+
commands and optional `--tx-submitter` use.
|
|
31
|
+
- Reclassified user-facing commands into `account`, `channel`, `wallet`, and `help` namespaces.
|
|
32
|
+
`install`, `uninstall`, and `--version` remain top-level commands.
|
|
33
|
+
- Renamed `get-my-l1-address` to `account get-l1-address` so account helpers live under the
|
|
34
|
+
same `account` command namespace as `account import`.
|
|
35
|
+
- Renamed `get-my-bridge-fund` to `account get-bridge-fund` so bridge-vault balance lookup is
|
|
36
|
+
grouped with account-level helpers.
|
|
37
|
+
- Moved bridge-vault movement commands to `account deposit-bridge` and `account withdraw-bridge`.
|
|
38
|
+
- Moved channel lifecycle commands to `channel create`, `channel recover-workspace`,
|
|
39
|
+
`channel get-meta`, `channel join`, and `channel exit`.
|
|
40
|
+
- Moved wallet-local state, channel balance, and note commands to `wallet recover-workspace`,
|
|
41
|
+
`wallet get-meta`, `wallet list`, `wallet deposit-channel`, `wallet withdraw-channel`,
|
|
42
|
+
`wallet get-channel-fund`, `wallet mint-notes`, `wallet transfer-notes`,
|
|
43
|
+
`wallet redeem-notes`, and `wallet get-notes`.
|
|
44
|
+
- Moved helper commands to `help commands`, `help update`, `help doctor`, `help guide`, and
|
|
45
|
+
`help transaction-fees`; `--help` still prints the same command reference for shell
|
|
46
|
+
compatibility.
|
|
47
|
+
- Updated README files, private-state workflow docs, the browser CLI assistant, transaction-fee
|
|
48
|
+
command labels, and the CLI e2e harness to use the new command taxonomy.
|
|
4
49
|
|
|
5
50
|
## 1.0.2 - 2026-05-06
|
|
6
51
|
|
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ private-state-cli <command> ...
|
|
|
48
48
|
Check the installed package and runtime state with:
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
private-state-cli doctor
|
|
51
|
+
private-state-cli help doctor
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Print only the installed CLI package version with:
|
|
@@ -60,7 +60,7 @@ private-state-cli --version
|
|
|
60
60
|
Check npm registry for a newer CLI package and update a global npm install when possible:
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
private-state-cli update
|
|
63
|
+
private-state-cli help update
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
`update` keeps `--version` suitable for scripts by using a separate command for registry checks. If the CLI is running
|
|
@@ -82,45 +82,76 @@ is globally installed.
|
|
|
82
82
|
|
|
83
83
|
A common private-state flow is:
|
|
84
84
|
|
|
85
|
-
1. `create
|
|
86
|
-
2. `deposit-bridge`
|
|
87
|
-
3. `join
|
|
88
|
-
4. `deposit-channel`
|
|
89
|
-
5. `mint-notes`
|
|
90
|
-
6. `transfer-notes`
|
|
91
|
-
7. `get-
|
|
92
|
-
8. `redeem-notes`
|
|
93
|
-
9. `withdraw-channel`
|
|
94
|
-
10. `exit
|
|
95
|
-
11. `withdraw-bridge`
|
|
96
|
-
|
|
97
|
-
Use `private-state-cli
|
|
85
|
+
1. `channel create`
|
|
86
|
+
2. `account deposit-bridge`
|
|
87
|
+
3. `channel join`
|
|
88
|
+
4. `wallet deposit-channel`
|
|
89
|
+
5. `wallet mint-notes`
|
|
90
|
+
6. `wallet transfer-notes`
|
|
91
|
+
7. `wallet get-notes`
|
|
92
|
+
8. `wallet redeem-notes`
|
|
93
|
+
9. `wallet withdraw-channel`
|
|
94
|
+
10. `channel exit`
|
|
95
|
+
11. `account withdraw-bridge`
|
|
96
|
+
|
|
97
|
+
Use `private-state-cli help commands` for the full command list and required options. `private-state-cli --help`
|
|
98
|
+
continues to print the same command list for shell compatibility.
|
|
98
99
|
|
|
99
100
|
Workspace recovery commands use the saved recovery index by default. If the local workspace is missing, corrupted, or
|
|
100
|
-
does not contain a usable index, `recover-workspace` and `recover-
|
|
101
|
+
does not contain a usable index, `channel recover-workspace` and `wallet recover-workspace` stop with an explicit error instead of
|
|
101
102
|
silently replaying logs from channel genesis. Use `--from-genesis` only when you intentionally want to rebuild from the
|
|
102
103
|
channel creation block:
|
|
103
104
|
|
|
104
105
|
```bash
|
|
105
|
-
private-state-cli recover-workspace --channel-name <CHANNEL> --network mainnet --from-genesis
|
|
106
|
-
private-state-cli recover-
|
|
106
|
+
private-state-cli channel recover-workspace --channel-name <CHANNEL> --network mainnet --from-genesis
|
|
107
|
+
private-state-cli wallet recover-workspace --channel-name <CHANNEL> --network mainnet --account <ACCOUNT> --from-genesis
|
|
107
108
|
```
|
|
108
109
|
|
|
109
|
-
`create
|
|
110
|
+
`channel create` is the exception: after the channel is created on-chain, the CLI initializes that new local workspace
|
|
110
111
|
by replaying from the channel's genesis block because no prior recovery index can exist for a new channel.
|
|
111
112
|
|
|
112
|
-
Wallet getter commands that need channel state, including `get-
|
|
113
|
-
`get-
|
|
113
|
+
Wallet getter commands that need channel state, including `wallet get-meta`, `wallet get-channel-fund`, and
|
|
114
|
+
`wallet get-notes`, follow the same indexed recovery rule before reading local or on-chain state. `wallet get-notes` also uses
|
|
114
115
|
the wallet's saved note-receive scan index for encrypted note delivery logs. If either index is unusable, the command
|
|
115
116
|
stops and asks the user to run the appropriate recovery command with `--from-genesis`.
|
|
116
117
|
|
|
118
|
+
Back up a local wallet with:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
private-state-cli wallet export --network mainnet --wallet <WALLET> --output ./wallet-backup.zip
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The default export stores the encrypted wallet, wallet metadata, and wallet-local secret. The encrypted `wallet.json`
|
|
125
|
+
contains the wallet's current key material and tracked note state. The export intentionally excludes account secrets
|
|
126
|
+
because wallet commands restore the L1 signer from the encrypted `wallet.json`; account secrets are only needed for
|
|
127
|
+
account-level bridge-vault commands and optional `--tx-submitter` use. After importing a default export on a new machine,
|
|
128
|
+
run `channel recover-workspace` before using wallet commands that need channel state:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
private-state-cli wallet import --input ./wallet-backup.zip
|
|
132
|
+
private-state-cli channel recover-workspace --channel-name <CHANNEL> --network mainnet --from-genesis
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
For a wider backup that can run wallet commands immediately when the imported channel workspace cache is still
|
|
136
|
+
chain-aligned, add `--include-notes`:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
private-state-cli wallet export --network mainnet --wallet <WALLET> --output ./wallet-backup.zip --include-notes
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Use `--all` to export every local mainnet wallet into one ZIP:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
private-state-cli wallet export --all --output ./mainnet-wallets.zip
|
|
146
|
+
```
|
|
147
|
+
|
|
117
148
|
Estimate live transaction costs before sending commands with:
|
|
118
149
|
|
|
119
150
|
```bash
|
|
120
|
-
private-state-cli transaction-fees --network mainnet --rpc-url <RPC_URL>
|
|
151
|
+
private-state-cli help transaction-fees --network mainnet --rpc-url <RPC_URL>
|
|
121
152
|
```
|
|
122
153
|
|
|
123
|
-
`transaction-fees` uses the measured gas data packaged in `assets/tx-fees.json`, the selected network's live fee data,
|
|
154
|
+
`help transaction-fees` uses the measured gas data packaged in `assets/tx-fees.json`, the selected network's live fee data,
|
|
124
155
|
and live ETH/USD pricing to print an ETH/USD fee table for transaction-sending commands. The table separates typical
|
|
125
156
|
cost, based on the RPC `gasPrice`, from worst-case cost, based on `maxFeePerGas` when the network reports EIP-1559 fee
|
|
126
157
|
data.
|
|
@@ -128,19 +159,19 @@ data.
|
|
|
128
159
|
Proof-backed note commands can use a separate L1 transaction submitter:
|
|
129
160
|
|
|
130
161
|
```bash
|
|
131
|
-
private-state-cli mint-notes --wallet <WALLET> --network mainnet --amounts '[1]' --tx-submitter <ACCOUNT>
|
|
162
|
+
private-state-cli wallet mint-notes --wallet <WALLET> --network mainnet --amounts '[1]' --tx-submitter <ACCOUNT>
|
|
132
163
|
```
|
|
133
164
|
|
|
134
|
-
`--tx-submitter <ACCOUNT>` is available on `mint-notes`, `transfer-notes`, and `redeem-notes`. The wallet still proves
|
|
165
|
+
`--tx-submitter <ACCOUNT>` is available on `wallet mint-notes`, `wallet transfer-notes`, and `wallet redeem-notes`. The wallet still proves
|
|
135
166
|
note ownership and builds the ZK proof, but the selected local account submits `executeChannelTransaction` and pays gas.
|
|
136
167
|
Use this option when you want stronger privacy by avoiding a direct on-chain link between the note owner's wallet L1
|
|
137
168
|
account and the proof-submission transaction.
|
|
138
169
|
|
|
139
170
|
Channel policy warning:
|
|
140
171
|
|
|
141
|
-
- `create
|
|
172
|
+
- `channel create` commits to an immutable channel policy: verifier bindings, DApp execution metadata, function layout,
|
|
142
173
|
managed storage vector, and refund policy are fixed for that channel.
|
|
143
|
-
- `join
|
|
174
|
+
- `channel join` means the user accepts the channel's current policy. Later policy-level fixes require a new channel or
|
|
144
175
|
migration; the existing channel is intentionally not mutated in place without renewed user consent.
|
|
145
176
|
- Before sending a channel-creation transaction or a first channel-registration transaction, the CLI prints the policy
|
|
146
177
|
snapshot that will be accepted: DApp metadata digest, digest schema, Groth16 verifier address, Groth16 compatible
|
|
@@ -149,7 +180,7 @@ Channel policy warning:
|
|
|
149
180
|
backend version is unexpected or has not been reviewed, do not create or join the channel. A later correction creates
|
|
150
181
|
a new channel; it does not rewrite the policy of an already-created channel.
|
|
151
182
|
|
|
152
|
-
`private-state-cli doctor` reports the CLI package version, dependency versions recorded by the last
|
|
183
|
+
`private-state-cli help doctor` reports the CLI package version, dependency versions recorded by the last
|
|
153
184
|
`private-state-cli install`, selected proof backend runtime versions, current dependency versions through `tokamak-l2js`, and Tokamak zk-EVM runtime
|
|
154
185
|
install mode, Docker mode, CUDA runtime metadata, live `nvidia-smi` and Docker GPU probe results, and Groth16
|
|
155
186
|
runtime health. The doctor check fails when the Tokamak Docker `useGpus` metadata does not match the live GPU probes.
|
|
@@ -158,23 +189,25 @@ Local helper commands:
|
|
|
158
189
|
|
|
159
190
|
```bash
|
|
160
191
|
private-state-cli account import --account <ACCOUNT_NAME> --network sepolia --private-key-file <PATH>
|
|
161
|
-
private-state-cli
|
|
162
|
-
private-state-cli
|
|
163
|
-
private-state-cli get-
|
|
192
|
+
private-state-cli account get-l1-address --account <ACCOUNT_NAME> --network sepolia
|
|
193
|
+
private-state-cli wallet list --network sepolia --channel-name cuda
|
|
194
|
+
private-state-cli wallet get-meta --wallet <WALLET_NAME> --network sepolia
|
|
195
|
+
private-state-cli wallet export --network sepolia --wallet <WALLET_NAME> --output ./wallet-backup.zip
|
|
196
|
+
private-state-cli wallet import --input ./wallet-backup.zip
|
|
164
197
|
```
|
|
165
198
|
|
|
166
199
|
`account import` is the only supported way to bring an L1 signing key into the CLI: it reads `--private-key-file` once
|
|
167
200
|
and stores a protected local account secret for later `--account` use. The source file does not need `0600` permissions.
|
|
168
|
-
`join
|
|
169
|
-
encrypted local wallet. `list
|
|
201
|
+
`channel join` imports `--wallet-secret-path <PATH>` into the protected wallet-local default secret while creating the
|
|
202
|
+
encrypted local wallet. `wallet list` reads only the local workspace and prints saved wallet names that can be reused with
|
|
170
203
|
`--wallet`.
|
|
171
|
-
`get-
|
|
172
|
-
on-chain channel registration match state. `get-
|
|
173
|
-
for a local account.
|
|
204
|
+
`wallet get-meta` opens an encrypted local wallet and reports the stored L1/L2 identity metadata plus the current
|
|
205
|
+
on-chain channel registration match state. `account get-l1-address` is a simple offline helper that derives the L1
|
|
206
|
+
address for a local account.
|
|
174
207
|
|
|
175
208
|
### Wallet Secret Source File
|
|
176
209
|
|
|
177
|
-
`join
|
|
210
|
+
`channel join` needs a wallet secret source file because the CLI no longer accepts raw wallet secrets on the command
|
|
178
211
|
line. The source file is arbitrary high-entropy secret text that the CLI reads once and imports into the protected
|
|
179
212
|
wallet-local canonical secret.
|
|
180
213
|
|
|
@@ -182,7 +215,7 @@ Create one before joining a channel:
|
|
|
182
215
|
|
|
183
216
|
```bash
|
|
184
217
|
openssl rand -hex 32 > ./wallet-secret.txt
|
|
185
|
-
private-state-cli
|
|
218
|
+
private-state-cli channel join --channel-name <CHANNEL> --network sepolia --account <ACCOUNT> --wallet-secret-path ./wallet-secret.txt
|
|
186
219
|
```
|
|
187
220
|
|
|
188
221
|
The import source file does not need `0600` permissions. The canonical wallet-local secret written by the CLI remains
|
|
@@ -227,9 +260,9 @@ Operating rules:
|
|
|
227
260
|
- An account is the local nickname created by `account import`. After import, signing commands should use
|
|
228
261
|
`--account <NAME>` instead of asking for the raw key again.
|
|
229
262
|
- A wallet secret source file is a separate high-entropy local secret chosen by the user for this private-state
|
|
230
|
-
wallet. It is not the L1 private key. `join
|
|
263
|
+
wallet. It is not the L1 private key. `channel join` imports it once and uses it to protect and recover the
|
|
231
264
|
channel-local wallet.
|
|
232
|
-
- A wallet is the encrypted local private-state wallet created during `join
|
|
265
|
+
- A wallet is the encrypted local private-state wallet created during `channel join`. Its deterministic name is
|
|
233
266
|
`<channelName>-<l1Address>`.
|
|
234
267
|
- The network RPC URL is the endpoint used to read and write chain state. It can be supplied once with `--rpc-url`
|
|
235
268
|
on a bridge-facing command, after which the CLI saves it under the selected network.
|
|
@@ -241,37 +274,37 @@ Operating rules:
|
|
|
241
274
|
their own node. Ask the user to create or select the endpoint in that provider's UI, then paste only the endpoint URL
|
|
242
275
|
into the CLI command that accepts `--rpc-url`; do not ask for provider account passwords, API dashboards, seed phrases,
|
|
243
276
|
private keys, or wallet secrets.
|
|
244
|
-
- When a user wants to join a channel, do not jump straight to `join
|
|
277
|
+
- When a user wants to join a channel, do not jump straight to `channel join`. Walk them through:
|
|
245
278
|
1. choose the network and channel name
|
|
246
279
|
2. run `private-state-cli install`
|
|
247
|
-
3. run `private-state-cli doctor`
|
|
280
|
+
3. run `private-state-cli help doctor`
|
|
248
281
|
4. obtain or confirm a network RPC URL for the selected network
|
|
249
282
|
5. prepare a private key source file locally, without pasting the key into chat
|
|
250
283
|
6. run `account import --account <NAME> --network <NETWORK> --private-key-file <PATH>`
|
|
251
284
|
7. prepare a wallet secret source file locally, for example with `openssl rand -hex 32 > ./wallet-secret.txt`
|
|
252
|
-
8. inspect the channel with `get-
|
|
285
|
+
8. inspect the channel with `channel get-meta` if it already exists, or create it with `channel create` if the user is
|
|
253
286
|
the channel creator
|
|
254
287
|
9. explain the immutable policy warning printed by the CLI
|
|
255
|
-
10. run `
|
|
288
|
+
10. run `channel join --channel-name <CHANNEL> --network <NETWORK> --account <ACCOUNT> --wallet-secret-path <PATH>`
|
|
256
289
|
- Before asking the user to create a file, explain what will be inside that file, who should be able to read it, and
|
|
257
290
|
whether losing it prevents wallet recovery.
|
|
258
291
|
- Prefer testnet examples unless the user explicitly asks for mainnet.
|
|
259
|
-
- Before any proof-backed or bridge-facing workflow, ask the user to run `private-state-cli doctor` and inspect
|
|
292
|
+
- Before any proof-backed or bridge-facing workflow, ask the user to run `private-state-cli help doctor` and inspect
|
|
260
293
|
whether the runtime, Docker mode, CUDA/GPU probes, Groth16 runtime, and deployment artifacts are healthy.
|
|
261
|
-
- Use `private-state-cli list
|
|
294
|
+
- Use `private-state-cli wallet list` to discover local wallet names instead of asking the user to inspect
|
|
262
295
|
filesystem paths manually.
|
|
263
|
-
- Use `private-state-cli get-
|
|
264
|
-
local account when wallet ownership needs to be identified.
|
|
265
|
-
- Use `private-state-cli get-
|
|
296
|
+
- Use `private-state-cli account get-l1-address --account <ACCOUNT> --network <NETWORK>` to derive the L1 address
|
|
297
|
+
for a local account when wallet ownership needs to be identified.
|
|
298
|
+
- Use `private-state-cli wallet get-meta --wallet <WALLET> --network <NETWORK>` to inspect
|
|
266
299
|
local wallet metadata and on-chain channel registration state.
|
|
267
|
-
- Use `private-state-cli get-
|
|
300
|
+
- Use `private-state-cli account get-bridge-fund` and `private-state-cli wallet get-channel-fund` to check balances before
|
|
268
301
|
telling the user to move funds.
|
|
269
302
|
- Explain that wallet names are local CLI identifiers, while private transfers use notes owned by L2 addresses
|
|
270
303
|
registered in the channel.
|
|
271
|
-
- Explain `--tx-submitter <ACCOUNT>` when the user wants stronger privacy for `mint-notes`, `transfer-notes`, or
|
|
272
|
-
`redeem-notes`: the wallet owner still proves note ownership, but another imported local L1 account can submit the
|
|
304
|
+
- Explain `--tx-submitter <ACCOUNT>` when the user wants stronger privacy for `wallet mint-notes`, `wallet transfer-notes`, or
|
|
305
|
+
`wallet redeem-notes`: the wallet owner still proves note ownership, but another imported local L1 account can submit the
|
|
273
306
|
on-chain `executeChannelTransaction` and pay gas.
|
|
274
|
-
- Before guiding a user through `create
|
|
307
|
+
- Before guiding a user through `channel create` or `channel join`, explain that channel policy is immutable after
|
|
275
308
|
creation and that joining a channel means accepting its current verifier, DApp metadata, function layout, managed
|
|
276
309
|
storage vector, and refund policy.
|
|
277
310
|
- Do not present one fixed command sequence as universally correct. Some flows start from an existing channel or wallet,
|
|
@@ -286,15 +319,15 @@ Suggested interaction flow:
|
|
|
286
319
|
1. Identify the target network, usually `sepolia` for testing.
|
|
287
320
|
2. Identify whether a channel already exists.
|
|
288
321
|
3. Identify the sender and recipient wallets or local account names.
|
|
289
|
-
4. Run `doctor`.
|
|
290
|
-
5. Run `list
|
|
291
|
-
6. If needed, guide the user through `create
|
|
292
|
-
`mint-notes`.
|
|
293
|
-
7. For a private transfer, select available note IDs from `get-
|
|
294
|
-
`get-
|
|
295
|
-
8. After transfer, guide the recipient to run `get-
|
|
322
|
+
4. Run `help doctor`.
|
|
323
|
+
5. Run `wallet list` and relevant metadata or balance checks.
|
|
324
|
+
6. If needed, guide the user through `channel create`, `account deposit-bridge`, `channel join`, `wallet deposit-channel`, and
|
|
325
|
+
`wallet mint-notes`.
|
|
326
|
+
7. For a private transfer, select available note IDs from `wallet get-notes`, find the recipient L2 address from
|
|
327
|
+
`wallet get-meta`, then build `wallet transfer-notes`.
|
|
328
|
+
8. After transfer, guide the recipient to run `wallet get-notes` to recover received notes from event logs.
|
|
296
329
|
|
|
297
|
-
Example onboarding explanation for `join
|
|
330
|
+
Example onboarding explanation for `channel join`:
|
|
298
331
|
|
|
299
332
|
> First we need two different local secrets. Your L1 private key proves which Ethereum account pays gas and signs
|
|
300
333
|
> bridge transactions. We import it once into a local account nickname, so later commands can say `--account alice`
|
|
@@ -312,7 +345,7 @@ command.
|
|
|
312
345
|
Proof-backed commands require installed bridge, DApp, and Groth16 artifacts. Run `private-state-cli install` before
|
|
313
346
|
using bridge-facing commands on a new machine.
|
|
314
347
|
|
|
315
|
-
Channel balance commands such as `deposit-channel` and `withdraw-channel` use the installed Groth16 runtime workspace
|
|
348
|
+
Channel balance commands such as `wallet deposit-channel` and `wallet withdraw-channel` use the installed Groth16 runtime workspace
|
|
316
349
|
directly. Proof generation writes to the fixed workspace paths under `~/tokamak-private-channels/groth16/proof`; the CLI
|
|
317
350
|
does not pass custom `--zkey`, proof-output, or public-output paths to the Groth16 prover.
|
|
318
351
|
Before proof generation, the CLI compares the target channel's verifier compatibility versions with the installed
|
package/assets/tx-fees.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"notes": [
|
|
6
6
|
"Gas values are protocol transaction gasUsed values, not a guarantee for every future calldata shape or verifier implementation.",
|
|
7
7
|
"ERC-20 approval transactions are listed as separate approve components when the CLI command sends an approval transaction.",
|
|
8
|
-
"transfer-notes and redeem-notes use the same proof-backed executeChannelTransaction baseline measured from the successful mint-notes CLI e2e receipt because the current e2e run stopped before producing fresh transfer/redeem receipts."
|
|
8
|
+
"wallet transfer-notes and wallet redeem-notes use the same proof-backed executeChannelTransaction baseline measured from the successful wallet mint-notes CLI e2e receipt because the current e2e run stopped before producing fresh transfer/redeem receipts."
|
|
9
9
|
],
|
|
10
10
|
"commands": [
|
|
11
11
|
{
|
|
12
|
-
"command": "create
|
|
12
|
+
"command": "channel create",
|
|
13
13
|
"description": "Create a bridge channel and initialize its policy snapshot.",
|
|
14
14
|
"transactions": [
|
|
15
15
|
{
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
"command": "deposit-bridge",
|
|
26
|
+
"command": "account deposit-bridge",
|
|
27
27
|
"description": "Deposit canonical tokens into the shared bridge vault.",
|
|
28
28
|
"transactions": [
|
|
29
29
|
{
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
"command": "withdraw-bridge",
|
|
48
|
+
"command": "account withdraw-bridge",
|
|
49
49
|
"description": "Withdraw canonical tokens from the shared bridge vault.",
|
|
50
50
|
"transactions": [
|
|
51
51
|
{
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
]
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
|
-
"command": "join
|
|
62
|
+
"command": "channel join",
|
|
63
63
|
"description": "Pay the channel join toll and register a wallet identity.",
|
|
64
64
|
"transactions": [
|
|
65
65
|
{
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"function": "approve",
|
|
69
69
|
"gasUsed": 45729,
|
|
70
70
|
"source": "cast-local-measurement",
|
|
71
|
-
"sourceDetail": "Measured on local anvil by deploying bridge/src/mocks/MockERC20.sol and sending approve(address,uint256).
|
|
71
|
+
"sourceDetail": "Measured on local anvil by deploying bridge/src/mocks/MockERC20.sol and sending approve(address,uint256). channel join sends this approval only when the channel join toll is nonzero."
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
"label": "joinChannel",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
|
-
"command": "deposit-channel",
|
|
84
|
+
"command": "wallet deposit-channel",
|
|
85
85
|
"description": "Move bridged funds into the channel L2 accounting vault.",
|
|
86
86
|
"transactions": [
|
|
87
87
|
{
|
|
@@ -92,12 +92,12 @@
|
|
|
92
92
|
"gasUsedMin": 336464,
|
|
93
93
|
"gasUsedMax": 336496,
|
|
94
94
|
"source": "cli-e2e-receipts",
|
|
95
|
-
"sourceDetail": "Three completed local CLI e2e deposit-channel receipts from the current worktree."
|
|
95
|
+
"sourceDetail": "Three completed local CLI e2e wallet deposit-channel receipts from the current worktree."
|
|
96
96
|
}
|
|
97
97
|
]
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
|
-
"command": "withdraw-channel",
|
|
100
|
+
"command": "wallet withdraw-channel",
|
|
101
101
|
"description": "Move channel L2 accounting vault funds back into the shared bridge vault.",
|
|
102
102
|
"transactions": [
|
|
103
103
|
{
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
]
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
|
-
"command": "exit
|
|
114
|
+
"command": "channel exit",
|
|
115
115
|
"description": "Exit a channel after the channel balance is zero.",
|
|
116
116
|
"transactions": [
|
|
117
117
|
{
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
]
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
|
-
"command": "mint-notes",
|
|
128
|
+
"command": "wallet mint-notes",
|
|
129
129
|
"description": "Submit a proof-backed private-state mint transaction.",
|
|
130
130
|
"transactions": [
|
|
131
131
|
{
|
|
@@ -134,12 +134,12 @@
|
|
|
134
134
|
"function": "executeChannelTransaction",
|
|
135
135
|
"gasUsed": 861627,
|
|
136
136
|
"source": "cli-e2e-receipt",
|
|
137
|
-
"sourceDetail": "Completed local CLI e2e mint-notes bridge-submit-receipt.json from the current worktree."
|
|
137
|
+
"sourceDetail": "Completed local CLI e2e wallet mint-notes bridge-submit-receipt.json from the current worktree."
|
|
138
138
|
}
|
|
139
139
|
]
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
|
-
"command": "transfer-notes",
|
|
142
|
+
"command": "wallet transfer-notes",
|
|
143
143
|
"description": "Submit a proof-backed private-state transfer transaction.",
|
|
144
144
|
"transactions": [
|
|
145
145
|
{
|
|
@@ -148,12 +148,12 @@
|
|
|
148
148
|
"function": "executeChannelTransaction",
|
|
149
149
|
"gasUsed": 861627,
|
|
150
150
|
"source": "cli-e2e-baseline",
|
|
151
|
-
"sourceDetail": "Uses the current successful mint-notes executeChannelTransaction receipt as the shared proof-backed DApp command baseline."
|
|
151
|
+
"sourceDetail": "Uses the current successful wallet mint-notes executeChannelTransaction receipt as the shared proof-backed DApp command baseline."
|
|
152
152
|
}
|
|
153
153
|
]
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
|
-
"command": "redeem-notes",
|
|
156
|
+
"command": "wallet redeem-notes",
|
|
157
157
|
"description": "Submit a proof-backed private-state redeem transaction.",
|
|
158
158
|
"transactions": [
|
|
159
159
|
{
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"function": "executeChannelTransaction",
|
|
163
163
|
"gasUsed": 861627,
|
|
164
164
|
"source": "cli-e2e-baseline",
|
|
165
|
-
"sourceDetail": "Uses the current successful mint-notes executeChannelTransaction receipt as the shared proof-backed DApp command baseline."
|
|
165
|
+
"sourceDetail": "Uses the current successful wallet mint-notes executeChannelTransaction receipt as the shared proof-backed DApp command baseline."
|
|
166
166
|
}
|
|
167
167
|
]
|
|
168
168
|
}
|