@tokamak-private-dapps/private-state-cli 1.0.1 → 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 +61 -2
- package/README.md +118 -54
- package/assets/tx-fees.json +16 -16
- package/cli-assistant.html +35 -35
- package/lib/private-state-cli-command-registry.mjs +141 -36
- package/lib/private-state-runtime-management.mjs +4 -2
- package/package.json +2 -1
- package/private-state-bridge-cli.mjs +948 -259
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,60 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
|
|
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.
|
|
49
|
+
|
|
50
|
+
## 1.0.2 - 2026-05-06
|
|
51
|
+
|
|
52
|
+
- Added `update`, which checks npm registry for the latest private-state CLI package and updates
|
|
53
|
+
global npm installs when a newer version exists.
|
|
54
|
+
- Kept repository checkouts and non-global installs read-only during `update`; those modes print
|
|
55
|
+
the exact `npm install -g @tokamak-private-dapps/private-state-cli@latest` command instead.
|
|
56
|
+
- Reused runtime-management output parsing helpers for `update` and `uninstall` instead of
|
|
57
|
+
duplicating npm JSON and ANSI-output handling in the CLI entrypoint.
|
|
5
58
|
- Added `transaction-fees`, which reads packaged measured gas data from `assets/tx-fees.json`,
|
|
6
59
|
combines it with live RPC fee data and live ETH/USD pricing, and prints a per-command ETH/USD
|
|
7
60
|
fee table.
|
|
@@ -15,6 +68,12 @@
|
|
|
15
68
|
guiding new users through `join-channel`.
|
|
16
69
|
- Added RPC log scan progress output to `recover-workspace` and `recover-wallet`, with progress
|
|
17
70
|
routed to stderr in `--json` mode so machine-readable command results stay valid.
|
|
71
|
+
- Added `recover-wallet --from-genesis` and removed implicit genesis replay fallback from
|
|
72
|
+
`recover-workspace` and `recover-wallet`; both commands now require a usable recovery index
|
|
73
|
+
unless the user explicitly requests `--from-genesis`.
|
|
74
|
+
- Changed `get-my-wallet-meta`, `get-my-channel-fund`, and `get-my-notes` to use indexed
|
|
75
|
+
recovery only before reading channel state, with `get-my-notes` also validating the wallet
|
|
76
|
+
note-receive recovery index before scanning delivery logs.
|
|
18
77
|
- Unified wallet command workspace refresh through the same recovery-indexed path used by
|
|
19
78
|
`recover-workspace`, and shared received-note recovery through the wallet's
|
|
20
79
|
`noteReceiveLastScannedBlock` index.
|
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:
|
|
@@ -57,6 +57,16 @@ Print only the installed CLI package version with:
|
|
|
57
57
|
private-state-cli --version
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
Check npm registry for a newer CLI package and update a global npm install when possible:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
private-state-cli help update
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`update` keeps `--version` suitable for scripts by using a separate command for registry checks. If the CLI is running
|
|
67
|
+
from a repository checkout or npm does not report a global install, it does not edit local source files; it prints the
|
|
68
|
+
recommended `npm install -g @tokamak-private-dapps/private-state-cli@latest` command instead.
|
|
69
|
+
|
|
60
70
|
Remove all local private-state CLI data with:
|
|
61
71
|
|
|
62
72
|
```bash
|
|
@@ -72,27 +82,76 @@ is globally installed.
|
|
|
72
82
|
|
|
73
83
|
A common private-state flow is:
|
|
74
84
|
|
|
75
|
-
1. `create
|
|
76
|
-
2. `deposit-bridge`
|
|
77
|
-
3. `join
|
|
78
|
-
4. `deposit-channel`
|
|
79
|
-
5. `mint-notes`
|
|
80
|
-
6. `transfer-notes`
|
|
81
|
-
7. `get-
|
|
82
|
-
8. `redeem-notes`
|
|
83
|
-
9. `withdraw-channel`
|
|
84
|
-
10. `exit
|
|
85
|
-
11. `withdraw-bridge`
|
|
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.
|
|
99
|
+
|
|
100
|
+
Workspace recovery commands use the saved recovery index by default. If the local workspace is missing, corrupted, or
|
|
101
|
+
does not contain a usable index, `channel recover-workspace` and `wallet recover-workspace` stop with an explicit error instead of
|
|
102
|
+
silently replaying logs from channel genesis. Use `--from-genesis` only when you intentionally want to rebuild from the
|
|
103
|
+
channel creation block:
|
|
86
104
|
|
|
87
|
-
|
|
105
|
+
```bash
|
|
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
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`channel create` is the exception: after the channel is created on-chain, the CLI initializes that new local workspace
|
|
111
|
+
by replaying from the channel's genesis block because no prior recovery index can exist for a new channel.
|
|
112
|
+
|
|
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
|
|
115
|
+
the wallet's saved note-receive scan index for encrypted note delivery logs. If either index is unusable, the command
|
|
116
|
+
stops and asks the user to run the appropriate recovery command with `--from-genesis`.
|
|
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
|
+
```
|
|
88
147
|
|
|
89
148
|
Estimate live transaction costs before sending commands with:
|
|
90
149
|
|
|
91
150
|
```bash
|
|
92
|
-
private-state-cli transaction-fees --network mainnet --rpc-url <RPC_URL>
|
|
151
|
+
private-state-cli help transaction-fees --network mainnet --rpc-url <RPC_URL>
|
|
93
152
|
```
|
|
94
153
|
|
|
95
|
-
`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,
|
|
96
155
|
and live ETH/USD pricing to print an ETH/USD fee table for transaction-sending commands. The table separates typical
|
|
97
156
|
cost, based on the RPC `gasPrice`, from worst-case cost, based on `maxFeePerGas` when the network reports EIP-1559 fee
|
|
98
157
|
data.
|
|
@@ -100,19 +159,19 @@ data.
|
|
|
100
159
|
Proof-backed note commands can use a separate L1 transaction submitter:
|
|
101
160
|
|
|
102
161
|
```bash
|
|
103
|
-
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>
|
|
104
163
|
```
|
|
105
164
|
|
|
106
|
-
`--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
|
|
107
166
|
note ownership and builds the ZK proof, but the selected local account submits `executeChannelTransaction` and pays gas.
|
|
108
167
|
Use this option when you want stronger privacy by avoiding a direct on-chain link between the note owner's wallet L1
|
|
109
168
|
account and the proof-submission transaction.
|
|
110
169
|
|
|
111
170
|
Channel policy warning:
|
|
112
171
|
|
|
113
|
-
- `create
|
|
172
|
+
- `channel create` commits to an immutable channel policy: verifier bindings, DApp execution metadata, function layout,
|
|
114
173
|
managed storage vector, and refund policy are fixed for that channel.
|
|
115
|
-
- `join
|
|
174
|
+
- `channel join` means the user accepts the channel's current policy. Later policy-level fixes require a new channel or
|
|
116
175
|
migration; the existing channel is intentionally not mutated in place without renewed user consent.
|
|
117
176
|
- Before sending a channel-creation transaction or a first channel-registration transaction, the CLI prints the policy
|
|
118
177
|
snapshot that will be accepted: DApp metadata digest, digest schema, Groth16 verifier address, Groth16 compatible
|
|
@@ -121,7 +180,7 @@ Channel policy warning:
|
|
|
121
180
|
backend version is unexpected or has not been reviewed, do not create or join the channel. A later correction creates
|
|
122
181
|
a new channel; it does not rewrite the policy of an already-created channel.
|
|
123
182
|
|
|
124
|
-
`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
|
|
125
184
|
`private-state-cli install`, selected proof backend runtime versions, current dependency versions through `tokamak-l2js`, and Tokamak zk-EVM runtime
|
|
126
185
|
install mode, Docker mode, CUDA runtime metadata, live `nvidia-smi` and Docker GPU probe results, and Groth16
|
|
127
186
|
runtime health. The doctor check fails when the Tokamak Docker `useGpus` metadata does not match the live GPU probes.
|
|
@@ -130,23 +189,25 @@ Local helper commands:
|
|
|
130
189
|
|
|
131
190
|
```bash
|
|
132
191
|
private-state-cli account import --account <ACCOUNT_NAME> --network sepolia --private-key-file <PATH>
|
|
133
|
-
private-state-cli
|
|
134
|
-
private-state-cli
|
|
135
|
-
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
|
|
136
197
|
```
|
|
137
198
|
|
|
138
199
|
`account import` is the only supported way to bring an L1 signing key into the CLI: it reads `--private-key-file` once
|
|
139
200
|
and stores a protected local account secret for later `--account` use. The source file does not need `0600` permissions.
|
|
140
|
-
`join
|
|
141
|
-
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
|
|
142
203
|
`--wallet`.
|
|
143
|
-
`get-
|
|
144
|
-
on-chain channel registration match state. `get-
|
|
145
|
-
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.
|
|
146
207
|
|
|
147
208
|
### Wallet Secret Source File
|
|
148
209
|
|
|
149
|
-
`join
|
|
210
|
+
`channel join` needs a wallet secret source file because the CLI no longer accepts raw wallet secrets on the command
|
|
150
211
|
line. The source file is arbitrary high-entropy secret text that the CLI reads once and imports into the protected
|
|
151
212
|
wallet-local canonical secret.
|
|
152
213
|
|
|
@@ -154,7 +215,7 @@ Create one before joining a channel:
|
|
|
154
215
|
|
|
155
216
|
```bash
|
|
156
217
|
openssl rand -hex 32 > ./wallet-secret.txt
|
|
157
|
-
private-state-cli
|
|
218
|
+
private-state-cli channel join --channel-name <CHANNEL> --network sepolia --account <ACCOUNT> --wallet-secret-path ./wallet-secret.txt
|
|
158
219
|
```
|
|
159
220
|
|
|
160
221
|
The import source file does not need `0600` permissions. The canonical wallet-local secret written by the CLI remains
|
|
@@ -199,48 +260,51 @@ Operating rules:
|
|
|
199
260
|
- An account is the local nickname created by `account import`. After import, signing commands should use
|
|
200
261
|
`--account <NAME>` instead of asking for the raw key again.
|
|
201
262
|
- A wallet secret source file is a separate high-entropy local secret chosen by the user for this private-state
|
|
202
|
-
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
|
|
203
264
|
channel-local wallet.
|
|
204
|
-
- 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
|
|
205
266
|
`<channelName>-<l1Address>`.
|
|
206
267
|
- The network RPC URL is the endpoint used to read and write chain state. It can be supplied once with `--rpc-url`
|
|
207
268
|
on a bridge-facing command, after which the CLI saves it under the selected network.
|
|
269
|
+
- A workspace recovery index is the saved block pointer and state-root hash that lets the CLI resume log scanning
|
|
270
|
+
without replaying the channel from its creation block. If it is missing, explain `--from-genesis` before using it
|
|
271
|
+
because genesis replay can take much longer.
|
|
208
272
|
- When the user does not have a network RPC URL yet, explain that they need an Ethereum JSON-RPC endpoint for the
|
|
209
273
|
selected network. They can obtain one from an infrastructure provider such as Alchemy, Infura, QuickNode, or from
|
|
210
274
|
their own node. Ask the user to create or select the endpoint in that provider's UI, then paste only the endpoint URL
|
|
211
275
|
into the CLI command that accepts `--rpc-url`; do not ask for provider account passwords, API dashboards, seed phrases,
|
|
212
276
|
private keys, or wallet secrets.
|
|
213
|
-
- 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:
|
|
214
278
|
1. choose the network and channel name
|
|
215
279
|
2. run `private-state-cli install`
|
|
216
|
-
3. run `private-state-cli doctor`
|
|
280
|
+
3. run `private-state-cli help doctor`
|
|
217
281
|
4. obtain or confirm a network RPC URL for the selected network
|
|
218
282
|
5. prepare a private key source file locally, without pasting the key into chat
|
|
219
283
|
6. run `account import --account <NAME> --network <NETWORK> --private-key-file <PATH>`
|
|
220
284
|
7. prepare a wallet secret source file locally, for example with `openssl rand -hex 32 > ./wallet-secret.txt`
|
|
221
|
-
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
|
|
222
286
|
the channel creator
|
|
223
287
|
9. explain the immutable policy warning printed by the CLI
|
|
224
|
-
10. run `
|
|
288
|
+
10. run `channel join --channel-name <CHANNEL> --network <NETWORK> --account <ACCOUNT> --wallet-secret-path <PATH>`
|
|
225
289
|
- Before asking the user to create a file, explain what will be inside that file, who should be able to read it, and
|
|
226
290
|
whether losing it prevents wallet recovery.
|
|
227
291
|
- Prefer testnet examples unless the user explicitly asks for mainnet.
|
|
228
|
-
- 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
|
|
229
293
|
whether the runtime, Docker mode, CUDA/GPU probes, Groth16 runtime, and deployment artifacts are healthy.
|
|
230
|
-
- Use `private-state-cli list
|
|
294
|
+
- Use `private-state-cli wallet list` to discover local wallet names instead of asking the user to inspect
|
|
231
295
|
filesystem paths manually.
|
|
232
|
-
- Use `private-state-cli get-
|
|
233
|
-
local account when wallet ownership needs to be identified.
|
|
234
|
-
- 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
|
|
235
299
|
local wallet metadata and on-chain channel registration state.
|
|
236
|
-
- 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
|
|
237
301
|
telling the user to move funds.
|
|
238
302
|
- Explain that wallet names are local CLI identifiers, while private transfers use notes owned by L2 addresses
|
|
239
303
|
registered in the channel.
|
|
240
|
-
- Explain `--tx-submitter <ACCOUNT>` when the user wants stronger privacy for `mint-notes`, `transfer-notes`, or
|
|
241
|
-
`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
|
|
242
306
|
on-chain `executeChannelTransaction` and pay gas.
|
|
243
|
-
- Before guiding a user through `create
|
|
307
|
+
- Before guiding a user through `channel create` or `channel join`, explain that channel policy is immutable after
|
|
244
308
|
creation and that joining a channel means accepting its current verifier, DApp metadata, function layout, managed
|
|
245
309
|
storage vector, and refund policy.
|
|
246
310
|
- Do not present one fixed command sequence as universally correct. Some flows start from an existing channel or wallet,
|
|
@@ -255,15 +319,15 @@ Suggested interaction flow:
|
|
|
255
319
|
1. Identify the target network, usually `sepolia` for testing.
|
|
256
320
|
2. Identify whether a channel already exists.
|
|
257
321
|
3. Identify the sender and recipient wallets or local account names.
|
|
258
|
-
4. Run `doctor`.
|
|
259
|
-
5. Run `list
|
|
260
|
-
6. If needed, guide the user through `create
|
|
261
|
-
`mint-notes`.
|
|
262
|
-
7. For a private transfer, select available note IDs from `get-
|
|
263
|
-
`get-
|
|
264
|
-
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.
|
|
265
329
|
|
|
266
|
-
Example onboarding explanation for `join
|
|
330
|
+
Example onboarding explanation for `channel join`:
|
|
267
331
|
|
|
268
332
|
> First we need two different local secrets. Your L1 private key proves which Ethereum account pays gas and signs
|
|
269
333
|
> bridge transactions. We import it once into a local account nickname, so later commands can say `--account alice`
|
|
@@ -281,7 +345,7 @@ command.
|
|
|
281
345
|
Proof-backed commands require installed bridge, DApp, and Groth16 artifacts. Run `private-state-cli install` before
|
|
282
346
|
using bridge-facing commands on a new machine.
|
|
283
347
|
|
|
284
|
-
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
|
|
285
349
|
directly. Proof generation writes to the fixed workspace paths under `~/tokamak-private-channels/groth16/proof`; the CLI
|
|
286
350
|
does not pass custom `--zkey`, proof-output, or public-output paths to the Groth16 prover.
|
|
287
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
|
}
|