@tokamak-private-dapps/private-state-cli 1.0.2 → 1.1.1
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 +64 -1
- package/README.md +100 -62
- package/assets/tx-fees.json +16 -16
- package/cli-assistant.html +35 -35
- package/lib/private-state-cli-command-registry.mjs +118 -34
- package/lib/private-state-runtime-management.mjs +2 -2
- package/package.json +2 -1
- package/private-state-bridge-cli.mjs +705 -216
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,69 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 1.1.1 - 2026-05-08
|
|
4
|
+
|
|
5
|
+
- Added bridge deployment verification support for Etherscan-compatible explorers, including
|
|
6
|
+
proxy and implementation verification for the main bridge contracts after deploy or upgrade
|
|
7
|
+
flows.
|
|
8
|
+
- Added an incremental ChannelManager verification script that scans channel creation events from
|
|
9
|
+
the last indexed block, skips already verified channel contracts, and persists scan progress for
|
|
10
|
+
later runs.
|
|
11
|
+
- Required `channel join` to refresh through the recovery index before joining an existing channel,
|
|
12
|
+
while preserving the explicit `--from-genesis` path for recovery commands that intentionally
|
|
13
|
+
rebuild workspace state from channel genesis.
|
|
14
|
+
- Verified the private-state CLI end-to-end flow with isolated local workspace state after the
|
|
15
|
+
indexed join recovery change.
|
|
16
|
+
|
|
17
|
+
## 1.1.0 - 2026-05-06
|
|
18
|
+
|
|
19
|
+
- Required `channel join` to use an existing recovered channel workspace and refresh through the
|
|
20
|
+
recovery index before submitting the join transaction, so old channels are not silently replayed
|
|
21
|
+
from genesis during join. `wallet recover-workspace --from-genesis` now also replays encrypted
|
|
22
|
+
note delivery logs from channel genesis for existing wallets.
|
|
23
|
+
- Refreshed channel workspaces through the existing recovery-indexed replay path after successful
|
|
24
|
+
wallet transactions instead of manually patching local snapshots, and bounded post-transaction
|
|
25
|
+
replay by the transaction receipt block so provider latest-block lag cannot skip the confirmed
|
|
26
|
+
transaction logs. This prevents stale `recoveryRootVectorHash` / `recoveryLastScannedBlock`
|
|
27
|
+
metadata after local state changes.
|
|
28
|
+
- Reported `usedWorkspaceCache` and `recoveredWorkspace` from channel vault move commands so
|
|
29
|
+
automated tests can verify that follow-up wallet transactions do not replay workspace recovery
|
|
30
|
+
when the local workspace is already current.
|
|
31
|
+
- Removed the local wallet folder and canonical wallet secret after successful `channel exit`, and
|
|
32
|
+
made `wallet recover-workspace` delete stale local wallet folders and canonical wallet secrets
|
|
33
|
+
when the corresponding L1 account is no longer registered on-chain.
|
|
34
|
+
- Improved `channel join` stale-wallet guidance. The command still does not delete stale wallets
|
|
35
|
+
itself; it tells users to run `wallet recover-workspace` first, and it overwrites the canonical
|
|
36
|
+
wallet secret from the provided `--wallet-secret-path` whenever a new local wallet is allowed.
|
|
37
|
+
- Normalized account command JSON `action` labels and CLI e2e helper names to the current
|
|
38
|
+
`account`, `channel`, and `wallet` command taxonomy.
|
|
39
|
+
- Added `wallet export` and `wallet import` for ZIP-based local wallet backup and restore.
|
|
40
|
+
The default export includes the encrypted wallet, wallet metadata, and wallet-local secret so
|
|
41
|
+
an imported wallet can be used after `channel recover-workspace`. Tracked notes remain preserved
|
|
42
|
+
because they live inside encrypted `wallet.json`; `--include-notes` also includes the channel
|
|
43
|
+
workspace cache needed to use wallet commands immediately when that cache is still chain-aligned.
|
|
44
|
+
- Hardened `wallet import` error handling for invalid ZIP or manifest data and staged imported
|
|
45
|
+
files in a temporary directory before committing them into the CLI data root.
|
|
46
|
+
- Kept account secrets out of wallet exports. Wallet commands restore their signer from the
|
|
47
|
+
encrypted `wallet.json`, while account secrets remain scoped to account-level bridge-vault
|
|
48
|
+
commands and optional `--tx-submitter` use.
|
|
49
|
+
- Reclassified user-facing commands into `account`, `channel`, `wallet`, and `help` namespaces.
|
|
50
|
+
`install`, `uninstall`, and `--version` remain top-level commands.
|
|
51
|
+
- Renamed `get-my-l1-address` to `account get-l1-address` so account helpers live under the
|
|
52
|
+
same `account` command namespace as `account import`.
|
|
53
|
+
- Renamed `get-my-bridge-fund` to `account get-bridge-fund` so bridge-vault balance lookup is
|
|
54
|
+
grouped with account-level helpers.
|
|
55
|
+
- Moved bridge-vault movement commands to `account deposit-bridge` and `account withdraw-bridge`.
|
|
56
|
+
- Moved channel lifecycle commands to `channel create`, `channel recover-workspace`,
|
|
57
|
+
`channel get-meta`, `channel join`, and `channel exit`.
|
|
58
|
+
- Moved wallet-local state, channel balance, and note commands to `wallet recover-workspace`,
|
|
59
|
+
`wallet get-meta`, `wallet list`, `wallet deposit-channel`, `wallet withdraw-channel`,
|
|
60
|
+
`wallet get-channel-fund`, `wallet mint-notes`, `wallet transfer-notes`,
|
|
61
|
+
`wallet redeem-notes`, and `wallet get-notes`.
|
|
62
|
+
- Moved helper commands to `help commands`, `help update`, `help doctor`, `help guide`, and
|
|
63
|
+
`help transaction-fees`; `--help` still prints the same command reference for shell
|
|
64
|
+
compatibility.
|
|
65
|
+
- Updated README files, private-state workflow docs, the browser CLI assistant, transaction-fee
|
|
66
|
+
command labels, and the CLI e2e harness to use the new command taxonomy.
|
|
4
67
|
|
|
5
68
|
## 1.0.2 - 2026-05-06
|
|
6
69
|
|
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,81 @@ 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
|
-
|
|
113
|
-
|
|
113
|
+
`channel join` requires the channel workspace to have a usable recovery index and refreshes that workspace through the
|
|
114
|
+
indexed path before submitting the registration transaction. For a channel that was created elsewhere, run
|
|
115
|
+
`channel recover-workspace --from-genesis` once before joining; later joins and wallet commands resume from the saved
|
|
116
|
+
index instead of silently replaying from genesis.
|
|
117
|
+
|
|
118
|
+
Wallet getter commands that need channel state, including `wallet get-meta`, `wallet get-channel-fund`, and
|
|
119
|
+
`wallet get-notes`, follow the same indexed recovery rule before reading local or on-chain state. `wallet get-notes` also uses
|
|
114
120
|
the wallet's saved note-receive scan index for encrypted note delivery logs. If either index is unusable, the command
|
|
115
121
|
stops and asks the user to run the appropriate recovery command with `--from-genesis`.
|
|
116
122
|
|
|
123
|
+
Back up a local wallet with:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
private-state-cli wallet export --network mainnet --wallet <WALLET> --output ./wallet-backup.zip
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The default export stores the encrypted wallet, wallet metadata, and wallet-local secret. The encrypted `wallet.json`
|
|
130
|
+
contains the wallet's current key material and tracked note state. The export intentionally excludes account secrets
|
|
131
|
+
because wallet commands restore the L1 signer from the encrypted `wallet.json`; account secrets are only needed for
|
|
132
|
+
account-level bridge-vault commands and optional `--tx-submitter` use. After importing a default export on a new machine,
|
|
133
|
+
run `channel recover-workspace` before using wallet commands that need channel state:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
private-state-cli wallet import --input ./wallet-backup.zip
|
|
137
|
+
private-state-cli channel recover-workspace --channel-name <CHANNEL> --network mainnet --from-genesis
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
For a wider backup that can run wallet commands immediately when the imported channel workspace cache is still
|
|
141
|
+
chain-aligned, add `--include-notes`:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
private-state-cli wallet export --network mainnet --wallet <WALLET> --output ./wallet-backup.zip --include-notes
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Use `--all` to export every local mainnet wallet into one ZIP:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
private-state-cli wallet export --all --output ./mainnet-wallets.zip
|
|
151
|
+
```
|
|
152
|
+
|
|
117
153
|
Estimate live transaction costs before sending commands with:
|
|
118
154
|
|
|
119
155
|
```bash
|
|
120
|
-
private-state-cli transaction-fees --network mainnet --rpc-url <RPC_URL>
|
|
156
|
+
private-state-cli help transaction-fees --network mainnet --rpc-url <RPC_URL>
|
|
121
157
|
```
|
|
122
158
|
|
|
123
|
-
`transaction-fees` uses the measured gas data packaged in `assets/tx-fees.json`, the selected network's live fee data,
|
|
159
|
+
`help transaction-fees` uses the measured gas data packaged in `assets/tx-fees.json`, the selected network's live fee data,
|
|
124
160
|
and live ETH/USD pricing to print an ETH/USD fee table for transaction-sending commands. The table separates typical
|
|
125
161
|
cost, based on the RPC `gasPrice`, from worst-case cost, based on `maxFeePerGas` when the network reports EIP-1559 fee
|
|
126
162
|
data.
|
|
@@ -128,19 +164,19 @@ data.
|
|
|
128
164
|
Proof-backed note commands can use a separate L1 transaction submitter:
|
|
129
165
|
|
|
130
166
|
```bash
|
|
131
|
-
private-state-cli mint-notes --wallet <WALLET> --network mainnet --amounts '[1]' --tx-submitter <ACCOUNT>
|
|
167
|
+
private-state-cli wallet mint-notes --wallet <WALLET> --network mainnet --amounts '[1]' --tx-submitter <ACCOUNT>
|
|
132
168
|
```
|
|
133
169
|
|
|
134
|
-
`--tx-submitter <ACCOUNT>` is available on `mint-notes`, `transfer-notes`, and `redeem-notes`. The wallet still proves
|
|
170
|
+
`--tx-submitter <ACCOUNT>` is available on `wallet mint-notes`, `wallet transfer-notes`, and `wallet redeem-notes`. The wallet still proves
|
|
135
171
|
note ownership and builds the ZK proof, but the selected local account submits `executeChannelTransaction` and pays gas.
|
|
136
172
|
Use this option when you want stronger privacy by avoiding a direct on-chain link between the note owner's wallet L1
|
|
137
173
|
account and the proof-submission transaction.
|
|
138
174
|
|
|
139
175
|
Channel policy warning:
|
|
140
176
|
|
|
141
|
-
- `create
|
|
177
|
+
- `channel create` commits to an immutable channel policy: verifier bindings, DApp execution metadata, function layout,
|
|
142
178
|
managed storage vector, and refund policy are fixed for that channel.
|
|
143
|
-
- `join
|
|
179
|
+
- `channel join` means the user accepts the channel's current policy. Later policy-level fixes require a new channel or
|
|
144
180
|
migration; the existing channel is intentionally not mutated in place without renewed user consent.
|
|
145
181
|
- Before sending a channel-creation transaction or a first channel-registration transaction, the CLI prints the policy
|
|
146
182
|
snapshot that will be accepted: DApp metadata digest, digest schema, Groth16 verifier address, Groth16 compatible
|
|
@@ -149,7 +185,7 @@ Channel policy warning:
|
|
|
149
185
|
backend version is unexpected or has not been reviewed, do not create or join the channel. A later correction creates
|
|
150
186
|
a new channel; it does not rewrite the policy of an already-created channel.
|
|
151
187
|
|
|
152
|
-
`private-state-cli doctor` reports the CLI package version, dependency versions recorded by the last
|
|
188
|
+
`private-state-cli help doctor` reports the CLI package version, dependency versions recorded by the last
|
|
153
189
|
`private-state-cli install`, selected proof backend runtime versions, current dependency versions through `tokamak-l2js`, and Tokamak zk-EVM runtime
|
|
154
190
|
install mode, Docker mode, CUDA runtime metadata, live `nvidia-smi` and Docker GPU probe results, and Groth16
|
|
155
191
|
runtime health. The doctor check fails when the Tokamak Docker `useGpus` metadata does not match the live GPU probes.
|
|
@@ -158,23 +194,25 @@ Local helper commands:
|
|
|
158
194
|
|
|
159
195
|
```bash
|
|
160
196
|
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-
|
|
197
|
+
private-state-cli account get-l1-address --account <ACCOUNT_NAME> --network sepolia
|
|
198
|
+
private-state-cli wallet list --network sepolia --channel-name cuda
|
|
199
|
+
private-state-cli wallet get-meta --wallet <WALLET_NAME> --network sepolia
|
|
200
|
+
private-state-cli wallet export --network sepolia --wallet <WALLET_NAME> --output ./wallet-backup.zip
|
|
201
|
+
private-state-cli wallet import --input ./wallet-backup.zip
|
|
164
202
|
```
|
|
165
203
|
|
|
166
204
|
`account import` is the only supported way to bring an L1 signing key into the CLI: it reads `--private-key-file` once
|
|
167
205
|
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
|
|
206
|
+
`channel join` imports `--wallet-secret-path <PATH>` into the protected wallet-local default secret while creating the
|
|
207
|
+
encrypted local wallet. `wallet list` reads only the local workspace and prints saved wallet names that can be reused with
|
|
170
208
|
`--wallet`.
|
|
171
|
-
`get-
|
|
172
|
-
on-chain channel registration match state. `get-
|
|
173
|
-
for a local account.
|
|
209
|
+
`wallet get-meta` opens an encrypted local wallet and reports the stored L1/L2 identity metadata plus the current
|
|
210
|
+
on-chain channel registration match state. `account get-l1-address` is a simple offline helper that derives the L1
|
|
211
|
+
address for a local account.
|
|
174
212
|
|
|
175
213
|
### Wallet Secret Source File
|
|
176
214
|
|
|
177
|
-
`join
|
|
215
|
+
`channel join` needs a wallet secret source file because the CLI no longer accepts raw wallet secrets on the command
|
|
178
216
|
line. The source file is arbitrary high-entropy secret text that the CLI reads once and imports into the protected
|
|
179
217
|
wallet-local canonical secret.
|
|
180
218
|
|
|
@@ -182,7 +220,7 @@ Create one before joining a channel:
|
|
|
182
220
|
|
|
183
221
|
```bash
|
|
184
222
|
openssl rand -hex 32 > ./wallet-secret.txt
|
|
185
|
-
private-state-cli
|
|
223
|
+
private-state-cli channel join --channel-name <CHANNEL> --network sepolia --account <ACCOUNT> --wallet-secret-path ./wallet-secret.txt
|
|
186
224
|
```
|
|
187
225
|
|
|
188
226
|
The import source file does not need `0600` permissions. The canonical wallet-local secret written by the CLI remains
|
|
@@ -227,9 +265,9 @@ Operating rules:
|
|
|
227
265
|
- An account is the local nickname created by `account import`. After import, signing commands should use
|
|
228
266
|
`--account <NAME>` instead of asking for the raw key again.
|
|
229
267
|
- 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
|
|
268
|
+
wallet. It is not the L1 private key. `channel join` imports it once and uses it to protect and recover the
|
|
231
269
|
channel-local wallet.
|
|
232
|
-
- A wallet is the encrypted local private-state wallet created during `join
|
|
270
|
+
- A wallet is the encrypted local private-state wallet created during `channel join`. Its deterministic name is
|
|
233
271
|
`<channelName>-<l1Address>`.
|
|
234
272
|
- The network RPC URL is the endpoint used to read and write chain state. It can be supplied once with `--rpc-url`
|
|
235
273
|
on a bridge-facing command, after which the CLI saves it under the selected network.
|
|
@@ -241,37 +279,37 @@ Operating rules:
|
|
|
241
279
|
their own node. Ask the user to create or select the endpoint in that provider's UI, then paste only the endpoint URL
|
|
242
280
|
into the CLI command that accepts `--rpc-url`; do not ask for provider account passwords, API dashboards, seed phrases,
|
|
243
281
|
private keys, or wallet secrets.
|
|
244
|
-
- When a user wants to join a channel, do not jump straight to `join
|
|
282
|
+
- When a user wants to join a channel, do not jump straight to `channel join`. Walk them through:
|
|
245
283
|
1. choose the network and channel name
|
|
246
284
|
2. run `private-state-cli install`
|
|
247
|
-
3. run `private-state-cli doctor`
|
|
285
|
+
3. run `private-state-cli help doctor`
|
|
248
286
|
4. obtain or confirm a network RPC URL for the selected network
|
|
249
287
|
5. prepare a private key source file locally, without pasting the key into chat
|
|
250
288
|
6. run `account import --account <NAME> --network <NETWORK> --private-key-file <PATH>`
|
|
251
289
|
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-
|
|
290
|
+
8. inspect the channel with `channel get-meta` if it already exists, or create it with `channel create` if the user is
|
|
253
291
|
the channel creator
|
|
254
292
|
9. explain the immutable policy warning printed by the CLI
|
|
255
|
-
10. run `
|
|
293
|
+
10. run `channel join --channel-name <CHANNEL> --network <NETWORK> --account <ACCOUNT> --wallet-secret-path <PATH>`
|
|
256
294
|
- Before asking the user to create a file, explain what will be inside that file, who should be able to read it, and
|
|
257
295
|
whether losing it prevents wallet recovery.
|
|
258
296
|
- 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
|
|
297
|
+
- Before any proof-backed or bridge-facing workflow, ask the user to run `private-state-cli help doctor` and inspect
|
|
260
298
|
whether the runtime, Docker mode, CUDA/GPU probes, Groth16 runtime, and deployment artifacts are healthy.
|
|
261
|
-
- Use `private-state-cli list
|
|
299
|
+
- Use `private-state-cli wallet list` to discover local wallet names instead of asking the user to inspect
|
|
262
300
|
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-
|
|
301
|
+
- Use `private-state-cli account get-l1-address --account <ACCOUNT> --network <NETWORK>` to derive the L1 address
|
|
302
|
+
for a local account when wallet ownership needs to be identified.
|
|
303
|
+
- Use `private-state-cli wallet get-meta --wallet <WALLET> --network <NETWORK>` to inspect
|
|
266
304
|
local wallet metadata and on-chain channel registration state.
|
|
267
|
-
- Use `private-state-cli get-
|
|
305
|
+
- Use `private-state-cli account get-bridge-fund` and `private-state-cli wallet get-channel-fund` to check balances before
|
|
268
306
|
telling the user to move funds.
|
|
269
307
|
- Explain that wallet names are local CLI identifiers, while private transfers use notes owned by L2 addresses
|
|
270
308
|
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
|
|
309
|
+
- Explain `--tx-submitter <ACCOUNT>` when the user wants stronger privacy for `wallet mint-notes`, `wallet transfer-notes`, or
|
|
310
|
+
`wallet redeem-notes`: the wallet owner still proves note ownership, but another imported local L1 account can submit the
|
|
273
311
|
on-chain `executeChannelTransaction` and pay gas.
|
|
274
|
-
- Before guiding a user through `create
|
|
312
|
+
- Before guiding a user through `channel create` or `channel join`, explain that channel policy is immutable after
|
|
275
313
|
creation and that joining a channel means accepting its current verifier, DApp metadata, function layout, managed
|
|
276
314
|
storage vector, and refund policy.
|
|
277
315
|
- Do not present one fixed command sequence as universally correct. Some flows start from an existing channel or wallet,
|
|
@@ -286,15 +324,15 @@ Suggested interaction flow:
|
|
|
286
324
|
1. Identify the target network, usually `sepolia` for testing.
|
|
287
325
|
2. Identify whether a channel already exists.
|
|
288
326
|
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-
|
|
327
|
+
4. Run `help doctor`.
|
|
328
|
+
5. Run `wallet list` and relevant metadata or balance checks.
|
|
329
|
+
6. If needed, guide the user through `channel create`, `account deposit-bridge`, `channel join`, `wallet deposit-channel`, and
|
|
330
|
+
`wallet mint-notes`.
|
|
331
|
+
7. For a private transfer, select available note IDs from `wallet get-notes`, find the recipient L2 address from
|
|
332
|
+
`wallet get-meta`, then build `wallet transfer-notes`.
|
|
333
|
+
8. After transfer, guide the recipient to run `wallet get-notes` to recover received notes from event logs.
|
|
296
334
|
|
|
297
|
-
Example onboarding explanation for `join
|
|
335
|
+
Example onboarding explanation for `channel join`:
|
|
298
336
|
|
|
299
337
|
> First we need two different local secrets. Your L1 private key proves which Ethereum account pays gas and signs
|
|
300
338
|
> bridge transactions. We import it once into a local account nickname, so later commands can say `--account alice`
|
|
@@ -312,7 +350,7 @@ command.
|
|
|
312
350
|
Proof-backed commands require installed bridge, DApp, and Groth16 artifacts. Run `private-state-cli install` before
|
|
313
351
|
using bridge-facing commands on a new machine.
|
|
314
352
|
|
|
315
|
-
Channel balance commands such as `deposit-channel` and `withdraw-channel` use the installed Groth16 runtime workspace
|
|
353
|
+
Channel balance commands such as `wallet deposit-channel` and `wallet withdraw-channel` use the installed Groth16 runtime workspace
|
|
316
354
|
directly. Proof generation writes to the fixed workspace paths under `~/tokamak-private-channels/groth16/proof`; the CLI
|
|
317
355
|
does not pass custom `--zkey`, proof-output, or public-output paths to the Groth16 prover.
|
|
318
356
|
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
|
}
|