@tokamak-private-dapps/private-state-cli 2.4.3 → 3.0.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/agents.md CHANGED
@@ -1,150 +1,1478 @@
1
1
  # private-state CLI Agent Instructions
2
2
 
3
- These instructions are for LLM agents that guide users through the `private-state-cli` package.
4
-
5
- You may act as an interactive guide for users who do not understand this CLI or the private-state DApp. Assume the
6
- user wants to use confidential channel-local notes while keeping L1 bridge deposits and withdrawals transparent.
7
- Translate the user's intent into safe, step-by-step CLI actions.
8
-
9
- Primary goal: help the user safely use private-state note workflows: self-custody L1 funding, channel-local note
10
- creation, note transfer, note recovery, and user-controlled disclosure where supported. Present this
11
- as privacy-preserving note semantics for the current `private-state` DApp, not as invisible
12
- activity or as a bridge-wide disclosure rule for every DApp.
13
-
14
- ## Operating Rules
15
-
16
- - Do not ask the user to reveal raw private keys or wallet secrets in chat. Use `account import --private-key-file`
17
- once, then use `--account` for L1 signing commands. Wallet viewing and spending authority is imported separately
18
- with `wallet import viewing-key` and `wallet import spending-key`.
19
- - Treat `private key file`, `account`, `wallet secret`, `wallet`, `network RPC URL`, and `channel policy` as
20
- new concepts unless the user has already demonstrated that they understand them. Define each term before using it
21
- in an instruction.
22
- - Explain local-secret handling in plain language:
23
- - A private key file is a local file that contains the user's L1 wallet private key. The CLI reads it once during
24
- `account import` and stores a protected local account secret.
25
- - An account is the local nickname created by `account import`. After import, signing commands should use
26
- `--account <NAME>` instead of asking for the raw key again.
27
- - A wallet secret source file is a separate high-entropy local secret chosen by the user for this private-state
28
- wallet. It is not the L1 private key. `channel join` reads it once for channel-bound spending-key derivation and
29
- does not persist it in the wallet workspace.
30
- - A wallet is the local private-state metadata set created during `channel join`. Its deterministic name is
31
- `<channelName>-<l1Address>`. The wallet backup tracks encrypted note state, while viewing and spending authority
32
- are stored in separate protected key files.
33
- - A viewing key decrypts encrypted note-delivery events for the registered note-receive public key. A spending key is
34
- the channel-bound L2 private key used to authorize note use. Do not describe either key as interchangeable with the
35
- other.
36
- - The network RPC URL is the endpoint used to read and write chain state. It must be configured once with
37
- `private-state-cli set rpc --network <NETWORK> --rpc-url <URL> --provider <PROVIDER>`, or with explicit
38
- `--log-requests-per-second` and `--block-range-cap` values when the provider is not built in.
39
- - A workspace recovery index is the saved block pointer and state-root hash that lets the CLI resume log scanning
40
- without replaying the channel from its creation block. If it is missing, check whether the channel has a registered
41
- workspace mirror before explaining or using `--from-genesis`, because genesis replay can take much longer.
42
- - Before guiding a user to run `channel recover-workspace --source rpc --from-genesis`, explain that RPC genesis
43
- recovery can be very slow because it scans channel logs from the creation block. Run or suggest
44
- `channel get-meta --channel-name <CHANNEL> --network <NETWORK>` first; if `workspaceMirror` is set, try
45
- `channel recover-workspace --channel-name <CHANNEL> --network <NETWORK> --source mirror`. Use RPC genesis replay only
46
- when no compatible workspace mirror is available.
47
- - When the user asks about gas use, transaction fees, transaction cost, or USD cost for private-state CLI commands, run
48
- `private-state-cli help transaction-fees --network <NETWORK> --json` and answer from the returned `rows`. If the
49
- network is unclear, ask which network to use. Do not tell the user to ask the developer unless the command fails after
50
- following the CLI's printed corrective guidance.
51
- - Prefer `--json` when running commands on behalf of a user. In JSON mode, parse stdout as the final success or failure
52
- result. Failures use `ok: false` on stdout. Progress, warning, and informational events are emitted as JSON Lines on
53
- stderr; stream or summarize those events for the human user instead of treating them as fatal by default.
54
- - When `channel recover-workspace` or `wallet recover-workspace` is unexpectedly slow, first inspect the RPC provider
55
- configured by `set rpc`. Explain that recovery speed is dominated by `eth_getLogs` block range cap and log request
56
- rate. Suggest re-running `set rpc` with a provider that supports a larger block range cap, such as Ankr or Chainnodes
57
- when appropriate, or with explicit `--log-requests-per-second` and `--block-range-cap` values from the provider's
58
- documentation.
59
- - When a channel leader needs to refresh workspace mirror files, guide them to run
60
- `channel recover-workspace --publish-workspace-mirror --leader-account <ACCOUNT> --output <PATH>`. The standalone
61
- `channel publish-workspace-mirror` command is no longer available.
62
- - When a CLI command fails, read the error message and any printed `Try:` hints first. Prefer the corrective action
63
- suggested by the CLI before inventing a different recovery sequence.
64
- - Treat `UnexpectedCurrentRootVector()` as a stale channel-root or stale-proof failure, not as evidence that the
65
- command shape is wrong. Do not recover by changing recipients, changing amounts, changing note counts, changing
66
- function arity, or splitting one intended transfer into multiple transfers. Refresh the channel workspace, re-check
67
- affected wallet state such as notes and balances, then rerun the user's original intended command so the CLI
68
- regenerates a proof from the fresh snapshot. If the original notes or balances are no longer usable after refresh,
69
- ask the user to choose a new plan instead of silently substituting one.
70
- - When the user does not have a network RPC URL yet, explain that they need an Ethereum JSON-RPC endpoint for the
71
- selected network. They can obtain one from an infrastructure provider such as Alchemy, Ankr, Chainstack, Chainnodes,
72
- QuickNode, or from their own node. Ask the user to create or select the endpoint in that provider's UI, then paste only
73
- the endpoint URL into `private-state-cli set rpc`; do not ask for provider account passwords, API dashboards, seed
74
- phrases, private keys, or wallet secrets.
75
- - When a user wants to join a channel, do not jump straight to `channel join`. Walk them through:
76
- 1. choose the network and channel name
77
- 2. run `private-state-cli install`
78
- 3. run `private-state-cli help doctor`
79
- 4. obtain or confirm a network RPC URL for the selected network
80
- 5. run `set rpc --network <NETWORK> --rpc-url <URL> --provider <PROVIDER>`, or use explicit scan limits for an
81
- unlisted provider
82
- 6. prepare a private key source file locally, without pasting the key into chat
83
- 7. run `account import --account <NAME> --network <NETWORK> --private-key-file <PATH>`
84
- 8. prepare a wallet secret source file locally, for example with `openssl rand -hex 32 > ./wallet-secret.txt`
85
- 9. inspect the channel with `channel get-meta` if it already exists, or create it with `channel create` if the user is
86
- the channel creator
87
- 10. explain the immutable policy warning and that the join toll is paid directly from the L1 wallet, not bridge-deposited balance
88
- 11. run `channel join --channel-name <CHANNEL> --network <NETWORK> --account <ACCOUNT> --wallet-secret-path <PATH> --acknowledge-action-impact`
89
- - Before executing any command for a user that requires an `--acknowledge-*` option, strongly warn the user in plain
90
- language about what that acknowledgement means and ask for explicit confirmation. Do not add
91
- `--acknowledge-action-impact` or `--acknowledge-full-note-plaintext-export` on the user's behalf until they confirm.
92
- For `--acknowledge-action-impact`, explain the command's public/private action-impact summary. For
93
- `--acknowledge-full-note-plaintext-export`, explain that all locally known note plaintext will be written into the
94
- exported ZIP.
95
- - Before asking the user to create a file, explain what will be inside that file, who should be able to read it, and
96
- whether losing it prevents wallet recovery.
97
- - Prefer testnet examples unless the user explicitly asks for mainnet.
98
- - Before any proof-backed or bridge-facing workflow, ask the user to run `private-state-cli help doctor` and inspect
99
- whether the runtime, Docker mode, CUDA/GPU probes, Groth16 runtime, and deployment artifacts are healthy.
100
- - Use `private-state-cli wallet list` to discover local wallet names instead of asking the user to inspect
101
- filesystem paths manually.
102
- - Use `private-state-cli account get-l1-address --account <ACCOUNT> --network <NETWORK>` to derive the L1 address
103
- for a local account when wallet ownership needs to be identified.
104
- - Use `private-state-cli wallet get-meta --wallet <WALLET> --network <NETWORK>` to inspect
105
- local wallet metadata and on-chain channel registration state.
106
- - Use `private-state-cli account get-bridge-fund` and `private-state-cli wallet get-channel-fund` to check balances before
107
- telling the user to move funds.
108
- - Explain that wallet names are local CLI identifiers, while confidential note transfers use notes owned by L2 addresses
109
- registered in the channel.
110
- - Explain `--tx-submitter <ACCOUNT>` when the user wants a separate L1 transaction submitter for `wallet mint-notes`,
111
- `wallet transfer-notes`, or `wallet redeem-notes`: the wallet owner still proves note ownership, but another imported
112
- local L1 account can submit the on-chain `executeChannelTransaction` and pay gas.
113
- - Before guiding a user through `channel create` or `channel join`, explain that channel policy is immutable after
114
- creation and that joining a channel means accepting its current verifier, DApp metadata, function layout, managed
115
- storage vector, and refund policy.
116
- - Do not present one fixed command sequence as universally correct. Some flows start from an existing channel or wallet,
117
- while others require creating or joining a channel first.
118
- - When the user asks for a transfer, first determine whether the sender has minted notes available. If not, guide them
119
- through joining or recovering the channel wallet, funding the bridge for channel liquidity, depositing into the channel, and minting notes.
120
- - When generating commands, use placeholders for secrets and explicit values for public fields. Show one command at a
121
- time unless the user asks for a batch.
122
-
123
- ## Suggested Interaction Flow
124
-
125
- 1. Identify the target network, usually `sepolia` for testing.
126
- 2. Identify whether a channel already exists.
127
- 3. Identify the sender and recipient wallets or local account names.
128
- 4. Run `help doctor`.
129
- 5. Run `wallet list` and relevant metadata or balance checks.
130
- 6. If needed, guide the user through `channel create`, `channel join`, `account deposit-bridge`, `wallet deposit-channel`, and
131
- `wallet mint-notes`.
132
- 7. For a confidential note transfer, select available note IDs from `wallet get-notes`, find the recipient L2 address from
133
- `wallet get-meta`, then build `wallet transfer-notes` with JSON arrays for `--note-ids`, `--recipients`, and `--amounts`.
134
- 8. After transfer, guide the recipient to run `wallet get-notes`; it refreshes received notes from the saved recovery index when the delta fits the 7,200-block pre-command budget. If the index is missing or too far behind, explain `wallet recover-workspace`.
135
-
136
- ## Example Onboarding Explanation For `channel join`
137
-
138
- > First we need two different local secrets. Your L1 private key proves which Ethereum account pays gas and signs
139
- > bridge transactions. We import it once into a local account nickname, so later commands can say `--account alice`
140
- > instead of handling the raw key again. Separately, the wallet secret source derives the channel-bound spending key
141
- > during `channel join`. It is not sent on-chain, it is not the same as your L1 private key, and the CLI does not store
142
- > it in the wallet workspace. A wallet backup restores encrypted tracking state; the viewing key restores note
143
- > readability; the spending key restores note spendability.
144
-
145
- ## Example Style
146
-
147
- If the user says, "ADDR6 sends 10 tokens privately to ADDR8", do not assume the required note exists.
148
- First ask or check which channel and network to use, whether ADDR6 and ADDR8 are already joined, what the local wallet
149
- names are, and whether ADDR6 has an unused note worth exactly 10 or notes that sum to 10. Then provide the next concrete
150
- command.
3
+ These instructions are for User-Controlled AI Agents guiding users through `private-state-cli`.
4
+
5
+ Start with:
6
+
7
+ ```bash
8
+ private-state-cli help guide --json
9
+ ```
10
+
11
+ When the guide result contains `agentGuidance.source: "agents.md"`, read every item listed in `agentGuidance.refs`
12
+ before telling the user what to do next. When the guide result contains `agentGuidance.termsSource` and
13
+ `agentGuidance.termsRefs`, read the listed Terms sections as the legal and safety context for the next action. The
14
+ indexed items below are written as action recipes: they prioritize the smallest safe user action over conceptual
15
+ explanation.
16
+
17
+ ## A. Operating Rules
18
+
19
+ ### A.1 Action-first setup
20
+
21
+ Goal: move the user to the next safe setup action with minimal required knowledge.
22
+
23
+ When to use: every first-time setup, recovery, funding, or note-flow step, especially when `help guide --json` returns
24
+ `select-network` or `collect-selectors`.
25
+
26
+ Minimal user actions: answer only the public selector questions needed for the next command, then run one command at a
27
+ time.
28
+
29
+ AI may ask: network, channel name, local account alias, local wallet name, amount, endpoint URL, and whether the user is
30
+ testing or using mainnet.
31
+
32
+ AI must not ask: raw private keys, wallet secrets, seed phrases, provider passwords, provider dashboard access, or
33
+ screenshots that reveal secrets.
34
+
35
+ Command template:
36
+
37
+ ```bash
38
+ private-state-cli help guide --network <NETWORK> --channel-name <CHANNEL> --account <ACCOUNT> --wallet <WALLET> --json
39
+ ```
40
+
41
+ Success check: the guide returns a concrete `nextSafeAction` and `agentGuidance.refs`.
42
+
43
+ Failure recovery: if required selectors are missing, ask for only the missing public selector values and rerun
44
+ `help guide --json`.
45
+
46
+ Optional explanation: use "Ethereum account", "Ethereum address", or "Ethereum wallet" with users. Use "L1" only when
47
+ quoting CLI command names, CLI output fields, or explaining why `account get-l1-address` uses that name. For ordinary
48
+ users, assume `mainnet` unless they explicitly say they are testing, developing, rehearsing, or using Sepolia/anvil.
49
+
50
+ ### A.2 Secret handling
51
+
52
+ Goal: keep secrets local to the user's terminal and filesystem.
53
+
54
+ When to use: any step involving private key source files, wallet secret source files, wallet keys, provider accounts, or
55
+ wallet recovery.
56
+
57
+ Minimal user actions: run the CLI helper that prompts locally with `*` masking, or point to an existing local file path.
58
+
59
+ AI may ask: whether the user wants the default local path or already has an existing local path.
60
+
61
+ AI must not ask: private key contents, wallet secret contents, seed phrases, wallet passwords, provider passwords, or
62
+ provider dashboard access.
63
+
64
+ Command template:
65
+
66
+ ```bash
67
+ private-state-cli secret create-private-key-source --output ./ethereum-private-key.txt
68
+ private-state-cli secret create-wallet-secret-source --output ./wallet-secret.txt
69
+ ```
70
+
71
+ Success check: the helper reports `secretPrinted: false` and an `outputPath`.
72
+
73
+ Failure recovery: if masked input is unavailable, tell the user to run the helper directly in an interactive terminal.
74
+ Do not replace the helper with chat-based secret collection.
75
+
76
+ Optional explanation: the source files are local inputs for later CLI commands; they are not meant to be pasted into
77
+ chat.
78
+
79
+ ### A.3 JSON guidance contract
80
+
81
+ Goal: make `help guide --json` a routing layer from local state to indexed instructions.
82
+
83
+ When to use: whenever an AI agent consumes `help guide --json`.
84
+
85
+ Minimal user actions: none; this is an AI interpretation rule.
86
+
87
+ AI may ask: nothing because of this item alone.
88
+
89
+ AI must not ask: the user to interpret `agentGuidance.refs` manually.
90
+
91
+ Command template:
92
+
93
+ ```bash
94
+ private-state-cli help guide --json
95
+ ```
96
+
97
+ Success check: `agentGuidance.source` is `agents.md` and `agentGuidance.refs` is a non-empty array.
98
+
99
+ Failure recovery: if refs are missing, use the CLI `nextSafeAction` conservatively and avoid inventing secret-handling
100
+ steps not covered by this document.
101
+
102
+ Optional explanation: JSON mode intentionally carries indexes instead of long guidance prose so the user's AI can read
103
+ the relevant `agents.md` items.
104
+
105
+ ## B. Secret Source Recipes
106
+
107
+ ### B.1 Create a private key source file
108
+
109
+ Goal: create a local source file that `account import` can read once without exposing the Ethereum private key to chat.
110
+
111
+ When to use: `help guide --json` indicates a missing account secret, or the user needs to import an Ethereum account.
112
+
113
+ Minimal user actions: run one helper command in an interactive terminal and type the Ethereum private key when prompted.
114
+
115
+ AI may ask: whether to use the default path `./ethereum-private-key.txt` or an existing custom local path.
116
+
117
+ AI must not ask: private key contents, seed phrase, wallet password, or screenshots showing the exported key.
118
+
119
+ Command template:
120
+
121
+ ```bash
122
+ private-state-cli secret create-private-key-source --output ./ethereum-private-key.txt
123
+ ```
124
+
125
+ Success check: the helper reports `outputPath` and `secretPrinted: false`; the next step is B.2.
126
+
127
+ Failure recovery: if the file already exists, do not overwrite it. Ask whether the existing file is intended or choose a
128
+ new local path. If terminal masking is unavailable, ask the user to run the helper directly in a terminal.
129
+
130
+ Optional explanation: a private key source file is a temporary local file containing the Ethereum private key so the CLI
131
+ can import it once into a protected account alias.
132
+
133
+ ### B.2 Import the Ethereum account
134
+
135
+ Goal: create a protected local account alias for later signing commands.
136
+
137
+ When to use: after B.1 succeeds, or when the user already has a private key source file.
138
+
139
+ Minimal user actions: choose or accept an account alias, then run the import command.
140
+
141
+ AI may ask: target network, account alias, and whether the user already has a custom local source path.
142
+
143
+ AI must not ask: private key contents, seed phrase, wallet password, or screenshots showing secrets.
144
+
145
+ Command template:
146
+
147
+ ```bash
148
+ private-state-cli account import --account <ACCOUNT> --network <NETWORK> --private-key-file ./ethereum-private-key.txt
149
+ ```
150
+
151
+ Success check:
152
+
153
+ ```bash
154
+ private-state-cli account get-l1-address --account <ACCOUNT> --network <NETWORK> --json
155
+ ```
156
+
157
+ Failure recovery: if the account already exists, do not overwrite it. Run the success check and ask the user whether the
158
+ displayed Ethereum address is the intended one. If the source file is invalid, ask the user to rerun B.1 locally.
159
+
160
+ Optional explanation: after import, signing commands use `--account <ACCOUNT>` instead of handling the raw private key.
161
+
162
+ ### B.3 Verify the imported Ethereum address
163
+
164
+ Goal: confirm that the local account alias points to the expected Ethereum address.
165
+
166
+ When to use: immediately after account import, or when wallet ownership needs to be identified.
167
+
168
+ Minimal user actions: run one read-only command and compare the displayed Ethereum address with the user's expected
169
+ wallet address.
170
+
171
+ AI may ask: account alias, network, and whether the displayed address is expected.
172
+
173
+ AI must not ask: private key contents, seed phrase, wallet password, or wallet screenshots containing secrets.
174
+
175
+ Command template:
176
+
177
+ ```bash
178
+ private-state-cli account get-l1-address --account <ACCOUNT> --network <NETWORK> --json
179
+ ```
180
+
181
+ Success check: the JSON result contains `l1Address`; describe it to the user as the Ethereum address.
182
+
183
+ Failure recovery: if the account is missing, return to B.1 and B.2. If the address is unexpected, do not proceed with
184
+ funding or channel join until the user imports the intended account under a new alias.
185
+
186
+ Optional explanation: `l1Address` is the CLI field name for the Ethereum-side address.
187
+
188
+ ### B.4 Create a wallet secret source file
189
+
190
+ Goal: create a local wallet secret source file for `channel join` without exposing the wallet secret to chat.
191
+
192
+ When to use: before `channel join`, or when `help guide --json` returns a missing wallet or missing registration state.
193
+
194
+ Minimal user actions: choose a strong password or passphrase they can retain, then run one helper command and type it in
195
+ the terminal prompt.
196
+
197
+ AI may ask: whether to use the default path `./wallet-secret.txt` or an existing custom local path.
198
+
199
+ AI must not ask: wallet secret contents, Ethereum private key contents, seed phrase, password/passphrase contents, or
200
+ screenshots showing secrets.
201
+
202
+ Command template:
203
+
204
+ ```bash
205
+ private-state-cli secret create-wallet-secret-source --output ./wallet-secret.txt
206
+ ```
207
+
208
+ Success check: the helper reports `outputPath`, `random: false`, and `secretPrinted: false`; the next step is B.6 or
209
+ B.7.
210
+
211
+ Failure recovery: if the file already exists, do not overwrite it. Ask whether the existing local file is intended or
212
+ choose a new path. If terminal masking is unavailable, ask the user to run the helper directly in a terminal.
213
+
214
+ Optional explanation: the wallet secret source is separate from the Ethereum private key and is used to derive
215
+ channel-bound wallet authority during `channel join`.
216
+
217
+ ### B.5 Random wallet secret opt-in
218
+
219
+ Goal: support random wallet secret creation only when the user explicitly wants random generation.
220
+
221
+ When to use: the user explicitly asks for a random wallet secret.
222
+
223
+ Minimal user actions: run the random helper command and preserve the resulting source file securely.
224
+
225
+ AI may ask: whether the user understands they must preserve the generated file for future recovery needs.
226
+
227
+ AI must not ask: wallet secret contents, private key contents, seed phrase, or password/passphrase contents.
228
+
229
+ Command template:
230
+
231
+ ```bash
232
+ private-state-cli secret create-wallet-secret-source --output ./wallet-secret.txt --random
233
+ ```
234
+
235
+ Success check: the helper reports `random: true`, `secretPrinted: false`, and an `outputPath`.
236
+
237
+ Failure recovery: if the file already exists, do not overwrite it. Choose a new path or use the existing intended file.
238
+
239
+ Optional explanation: random generation can reduce memorability and increase loss risk unless the source file or later
240
+ exported recovery material is preserved.
241
+
242
+ ### B.6 Wallet secret recovery reminder
243
+
244
+ Goal: ensure the user preserves the wallet secret source before a channel join depends on it.
245
+
246
+ When to use: after B.4 or B.5 and before B.7.
247
+
248
+ Minimal user actions: keep the source file private and preserve a recoverable copy if future recovery matters.
249
+
250
+ AI may ask: whether the user has preserved the file or password/passphrase outside chat.
251
+
252
+ AI must not ask: the wallet secret, backup contents, seed phrase, private key, or screenshots of secret storage.
253
+
254
+ Command template:
255
+
256
+ ```bash
257
+ private-state-cli secret create-wallet-secret-source --output ./wallet-secret.txt
258
+ ```
259
+
260
+ Success check: the user confirms the source file or passphrase has been preserved without revealing it.
261
+
262
+ Failure recovery: if the user has not preserved it, pause before channel join and let them back it up locally.
263
+
264
+ Optional explanation: losing wallet secret material can prevent rederiving spending authority if protected key files are
265
+ also lost.
266
+
267
+ ### B.7 Join a channel with the wallet secret source
268
+
269
+ Goal: join a channel and create/register the local private-state wallet using the prepared wallet secret source.
270
+
271
+ When to use: after L1 signing authority is available through either an imported local account alias or a browser wallet,
272
+ RPC is configured, the channel/workspace is ready, and the wallet secret source exists.
273
+
274
+ Minimal user actions: review the channel policy and CLI warning summary, then run the join command directly.
275
+
276
+ AI may ask: channel name, network, whether the user wants a local account alias or browser wallet L1 signing, and wallet
277
+ secret source path.
278
+
279
+ AI must not ask: wallet secret contents, Ethereum private key contents, seed phrase, or password/passphrase contents.
280
+
281
+ Command template:
282
+
283
+ ```bash
284
+ private-state-cli channel join --channel-name <CHANNEL> --network <NETWORK> --wallet-secret-path ./wallet-secret.txt
285
+ ```
286
+
287
+ Local-account variant:
288
+
289
+ ```bash
290
+ private-state-cli channel join --channel-name <CHANNEL> --network <NETWORK> --account <ACCOUNT> --wallet-secret-path ./wallet-secret.txt
291
+ ```
292
+
293
+ Success check:
294
+
295
+ ```bash
296
+ private-state-cli wallet list --network <NETWORK> --channel-name <CHANNEL> --json
297
+ private-state-cli wallet get-meta --wallet <WALLET> --network <NETWORK> --json
298
+ ```
299
+
300
+ Failure recovery: if the channel workspace is missing, follow D.7. If the user is not ready to accept the policy or
301
+ warning summary, stop and do not join. If registration already exists, use wallet recovery or normal wallet commands
302
+ instead of joining again.
303
+
304
+ Optional explanation: joining creates/registers the private-state wallet for that channel and may pay the Join Toll
305
+ directly from the Ethereum account. When `--account` is omitted, the CLI opens a local signing page and the user approves
306
+ the account connection, chain check, L2 spending-key message signature, note-receive viewing-key typed-data signature,
307
+ any Join Toll approval, and the join transaction in a MetaMask-compatible browser wallet. The AI must not approve wallet
308
+ requests for the user.
309
+
310
+ ## C. RPC Setup Recipes
311
+
312
+ ### C.1 Confirm the network
313
+
314
+ Goal: choose the correct network before configuring RPC or running chain-facing commands.
315
+
316
+ When to use: no network selector is provided, or RPC setup is needed.
317
+
318
+ Minimal user actions: confirm mainnet or explicitly choose a test/developer network.
319
+
320
+ AI may ask: whether the user is using mainnet, Sepolia, anvil, testing, development, or rehearsal.
321
+
322
+ AI must not ask: private keys, wallet secrets, seed phrases, provider passwords, or dashboard access.
323
+
324
+ Command template:
325
+
326
+ ```bash
327
+ private-state-cli help guide --network mainnet --json
328
+ ```
329
+
330
+ Success check: the guide proceeds to RPC, install, account, channel, or wallet checks for the selected network.
331
+
332
+ Failure recovery: if the user selected the wrong network, rerun `help guide --network <NETWORK> --json` with the
333
+ correct network before setting RPC.
334
+
335
+ Optional explanation: ordinary end users should use `mainnet`; Sepolia is for explicit test, development, or rehearsal
336
+ flows.
337
+
338
+ ### C.2 Recommend Ankr without treating it as a default
339
+
340
+ Goal: reduce provider choice burden while making clear that the user still must provide a real RPC URL.
341
+
342
+ When to use: RPC is missing and the user has no provider preference.
343
+
344
+ Minimal user actions: open Ankr, create or select an Ethereum mainnet endpoint, and copy only the endpoint URL.
345
+
346
+ AI may ask: whether the user already has a provider, paid endpoint, organization requirement, or self-hosted node.
347
+
348
+ AI must not ask: provider password, provider dashboard access, seed phrase, private key, wallet secret, or API dashboard
349
+ screenshots.
350
+
351
+ Command template:
352
+
353
+ ```bash
354
+ private-state-cli set rpc --network <NETWORK> --rpc-url <URL> --provider ankr
355
+ ```
356
+
357
+ Success check:
358
+
359
+ ```bash
360
+ private-state-cli help guide --network <NETWORK> --json
361
+ ```
362
+
363
+ Failure recovery: if the user must use another provider, follow C.4 for built-in providers or C.5 for unlisted
364
+ providers.
365
+
366
+ Optional explanation: Ankr is recommended because its free RPC plan is expected to be faster for this CLI's log-scanning
367
+ workload than typical free alternatives. This is a recommendation, not a CLI default.
368
+
369
+ ### C.3 Ask only for the endpoint URL
370
+
371
+ Goal: collect only the non-secret value needed for RPC configuration.
372
+
373
+ When to use: the user is obtaining an RPC endpoint from Ankr or another provider.
374
+
375
+ Minimal user actions: copy the final endpoint URL and provide that URL only.
376
+
377
+ AI may ask: endpoint URL and selected network.
378
+
379
+ AI must not ask: provider login credentials, dashboard access, seed phrase, private key, wallet secret, billing details,
380
+ or screenshots of provider pages containing secrets.
381
+
382
+ Command template:
383
+
384
+ ```bash
385
+ private-state-cli set rpc --network <NETWORK> --rpc-url <URL> --provider ankr
386
+ ```
387
+
388
+ Success check: `set rpc` succeeds and a follow-up `help guide --network <NETWORK> --json` no longer reports missing RPC.
389
+
390
+ Failure recovery: if the endpoint is missing or malformed, ask the user to copy the endpoint URL again from the provider
391
+ UI.
392
+
393
+ Optional explanation: the endpoint URL is the only provider value the CLI needs for normal setup.
394
+
395
+ ### C.4 Configure RPC
396
+
397
+ Goal: save the per-network RPC configuration used by bridge-facing and wallet commands.
398
+
399
+ When to use: the user has the endpoint URL and selected network.
400
+
401
+ Minimal user actions: run one `set rpc` command.
402
+
403
+ AI may ask: network, endpoint URL, and provider name if the user chose a built-in provider other than Ankr.
404
+
405
+ AI must not ask: provider passwords, seed phrases, private keys, wallet secrets, or dashboard access.
406
+
407
+ Command template:
408
+
409
+ ```bash
410
+ private-state-cli set rpc --network <NETWORK> --rpc-url <URL> --provider ankr
411
+ ```
412
+
413
+ Success check:
414
+
415
+ ```bash
416
+ private-state-cli help guide --network <NETWORK> --json
417
+ ```
418
+
419
+ Failure recovery: if chain ID validation fails, ask the user to create or select an endpoint for the requested network.
420
+ If the provider is not built in, follow C.5.
421
+
422
+ Optional explanation: the CLI stores RPC settings under the private-state workspace for that network.
423
+
424
+ ### C.5 Missing RPC and unlisted provider recovery
425
+
426
+ Goal: handle missing RPC configuration or providers that are not in the built-in provider table.
427
+
428
+ When to use: RPC is missing, `set rpc --provider <PROVIDER>` is not supported, or recovery is slow because scan limits
429
+ are too low.
430
+
431
+ Minimal user actions: either use Ankr, use another built-in provider, or provide the unlisted provider's documented
432
+ `eth_getLogs` request rate and block range cap.
433
+
434
+ AI may ask: whether the user can use Ankr, or the provider's documented `eth_getLogs` rate and block range cap.
435
+
436
+ AI must not ask: provider passwords, dashboard access, seed phrases, private keys, wallet secrets, or undocumented guess
437
+ values.
438
+
439
+ Command template:
440
+
441
+ ```bash
442
+ private-state-cli set rpc --network <NETWORK> --rpc-url <URL> --log-requests-per-second <N> --block-range-cap <N>
443
+ ```
444
+
445
+ Success check: `help guide --network <NETWORK> --json` no longer reports `MISSING_RPC_URL`.
446
+
447
+ Failure recovery: if the provider limits are unknown, recommend Ankr or ask the user to consult provider documentation.
448
+ Do not invent scan limits.
449
+
450
+ Optional explanation: without RPC configuration, later bridge-facing and wallet commands fail; the CLI does not use a
451
+ default RPC URL.
452
+
453
+ ## D. Guided Setup Flow
454
+
455
+ ### D.1 Select network and public selectors
456
+
457
+ Goal: collect the smallest public selector set needed for `help guide --json`.
458
+
459
+ When to use: the guide lacks network, channel, account, or wallet selectors.
460
+
461
+ Minimal user actions: provide public names only.
462
+
463
+ AI may ask: network, channel name, account alias, and wallet name.
464
+
465
+ AI must not ask: private keys, wallet secrets, seed phrases, or provider credentials.
466
+
467
+ Command template:
468
+
469
+ ```bash
470
+ private-state-cli help guide --network <NETWORK> --channel-name <CHANNEL> --account <ACCOUNT> --wallet <WALLET> --json
471
+ ```
472
+
473
+ Success check: the guide returns a more specific `nextSafeAction`.
474
+
475
+ Failure recovery: if the user does not know the wallet name, follow D.9.
476
+
477
+ Optional explanation: public selectors help the CLI inspect local and on-chain state; they are not secret values.
478
+
479
+ ### D.2 Install runtime
480
+
481
+ Goal: install and verify runtime artifacts before bridge-facing workflows.
482
+
483
+ When to use: `help guide --json` reports missing deployment artifacts or runtime readiness.
484
+
485
+ Minimal user actions: run install, then doctor.
486
+
487
+ AI may ask: whether the user needs read-only mode or full transaction-sending mode only if that choice matters.
488
+
489
+ AI must not ask: secrets or provider credentials.
490
+
491
+ Command template:
492
+
493
+ ```bash
494
+ private-state-cli install
495
+ private-state-cli help doctor
496
+ ```
497
+
498
+ Success check: `help doctor` reports required command availability and artifact readiness.
499
+
500
+ Failure recovery: follow the `help doctor` output and CLI error hints before inventing a different install sequence.
501
+
502
+ Optional explanation: full install is needed for proof-backed or transaction-sending workflows; read-only install is
503
+ limited.
504
+
505
+ ### D.3 Configure RPC
506
+
507
+ Goal: complete network RPC setup before commands that read or write chain state.
508
+
509
+ When to use: `help guide --json` reports missing RPC.
510
+
511
+ Minimal user actions: follow C.1 through C.4.
512
+
513
+ AI may ask: network and endpoint URL.
514
+
515
+ AI must not ask: provider password, provider dashboard access, seed phrase, private key, or wallet secret.
516
+
517
+ Command template:
518
+
519
+ ```bash
520
+ private-state-cli set rpc --network <NETWORK> --rpc-url <URL> --provider ankr
521
+ ```
522
+
523
+ Success check: rerun `help guide --network <NETWORK> --json`; the network RPC check is no longer missing.
524
+
525
+ Failure recovery: follow C.5 for missing RPC, unsupported provider, or slow recovery due to scan limits.
526
+
527
+ Optional explanation: RPC configuration is required; there is no default RPC.
528
+
529
+ ### D.4 Prepare and import the Ethereum account
530
+
531
+ Goal: create a local account alias ready for signing.
532
+
533
+ When to use: the selected account alias has no protected local account secret.
534
+
535
+ Minimal user actions: run B.1, run B.2, then verify with B.3.
536
+
537
+ AI may ask: account alias, network, and whether to use the default source path or an existing local path.
538
+
539
+ AI must not ask: private key contents, seed phrase, wallet password, or screenshots showing secrets.
540
+
541
+ Command template:
542
+
543
+ ```bash
544
+ private-state-cli secret create-private-key-source --output ./ethereum-private-key.txt
545
+ private-state-cli account import --account <ACCOUNT> --network <NETWORK> --private-key-file ./ethereum-private-key.txt
546
+ private-state-cli account get-l1-address --account <ACCOUNT> --network <NETWORK> --json
547
+ ```
548
+
549
+ Success check: `account get-l1-address --json` returns the expected Ethereum address.
550
+
551
+ Failure recovery: follow B.1, B.2, or B.3 depending on the failing command.
552
+
553
+ Optional explanation: this imports the Ethereum account once so later commands use `--account <ACCOUNT>`.
554
+
555
+ ### D.5 Prepare the wallet secret source
556
+
557
+ Goal: create and preserve the wallet secret source before channel join.
558
+
559
+ When to use: before B.7 or when the guide recommends creating a wallet secret source.
560
+
561
+ Minimal user actions: run B.4 or, only by explicit request, B.5; then confirm local preservation with B.6.
562
+
563
+ AI may ask: wallet secret source path preference and whether the user explicitly wants random generation.
564
+
565
+ AI must not ask: wallet secret contents, private key contents, seed phrase, or password/passphrase contents.
566
+
567
+ Command template:
568
+
569
+ ```bash
570
+ private-state-cli secret create-wallet-secret-source --output ./wallet-secret.txt
571
+ ```
572
+
573
+ Success check: the helper reports `secretPrinted: false`, and the user confirms the source is preserved locally.
574
+
575
+ Failure recovery: if the file is missing before join, rerun B.4 or provide an existing local path.
576
+
577
+ Optional explanation: this source derives channel-bound wallet authority and is separate from the Ethereum private key.
578
+
579
+ ### D.6 Inspect or create channel
580
+
581
+ Goal: determine whether a channel exists and whether the user should recover, create, or join.
582
+
583
+ When to use: before joining or creating a channel.
584
+
585
+ Minimal user actions: run channel metadata inspection; create a channel only if the user is the channel creator and
586
+ confirms policy impact.
587
+
588
+ AI may ask: channel name, network, whether the user is the channel creator, Join Toll, and explicit confirmation for
589
+ transaction-sending commands.
590
+
591
+ AI must not ask: private keys, wallet secrets, seed phrases, or provider credentials.
592
+
593
+ Command template:
594
+
595
+ ```bash
596
+ private-state-cli channel get-meta --channel-name <CHANNEL> --network <NETWORK>
597
+ ```
598
+
599
+ Success check: channel metadata indicates whether the channel exists, whether a workspace mirror is registered, and
600
+ whether a Channel-scoped observer URL is registered.
601
+
602
+ Failure recovery: if the channel exists but the local workspace is missing, follow D.7. If the channel does not exist
603
+ and the user is not the creator, stop and ask for the correct channel.
604
+
605
+ Optional explanation: channel creation fixes policy for that channel; joining means accepting that policy. Mirror and
606
+ observer URLs are Channel-scoped metadata; do not infer them from Tonigma-level documentation or another Channel.
607
+
608
+ ### D.7 Recover channel workspace
609
+
610
+ Goal: rebuild local channel workspace state before wallet operations.
611
+
612
+ When to use: the channel exists but local channel workspace is missing or unusable.
613
+
614
+ Minimal user actions: use mirror recovery when available; use genesis RPC replay only when necessary.
615
+
616
+ AI may ask: channel name, network, and whether a compatible workspace mirror is available.
617
+
618
+ AI must not ask: private keys, wallet secrets, seed phrases, or provider credentials.
619
+
620
+ Command template:
621
+
622
+ ```bash
623
+ private-state-cli channel recover-workspace --channel-name <CHANNEL> --network <NETWORK> --source mirror
624
+ ```
625
+
626
+ Success check: rerun `help guide --network <NETWORK> --channel-name <CHANNEL> --json`; channel workspace is no longer
627
+ missing.
628
+
629
+ Failure recovery: if no compatible mirror exists, warn about slow genesis replay and then use:
630
+
631
+ ```bash
632
+ private-state-cli channel recover-workspace --channel-name <CHANNEL> --network <NETWORK> --source rpc --from-genesis
633
+ ```
634
+
635
+ Optional explanation: workspace recovery rebuilds local channel state from public chain logs or a trusted registered
636
+ mirror.
637
+
638
+ ### D.8 Join channel
639
+
640
+ Goal: complete channel join only after policy and warning review.
641
+
642
+ When to use: the account, RPC, artifacts, channel workspace, and wallet secret source are ready.
643
+
644
+ Minimal user actions: review the warning and run B.7 directly.
645
+
646
+ AI may ask: whether the user has read the channel policy and warning summary.
647
+
648
+ AI must not ask: wallet secret contents, private key contents, seed phrase, or password/passphrase contents.
649
+
650
+ Browser-wallet command template:
651
+
652
+ ```bash
653
+ private-state-cli channel join --channel-name <CHANNEL> --network <NETWORK> --wallet-secret-path ./wallet-secret.txt
654
+ ```
655
+
656
+ Local-account command template:
657
+
658
+ ```bash
659
+ private-state-cli channel join --channel-name <CHANNEL> --network <NETWORK> --account <ACCOUNT> --wallet-secret-path ./wallet-secret.txt
660
+ ```
661
+
662
+ Success check: run `wallet list` and `wallet get-meta` as shown in B.7.
663
+
664
+ Failure recovery: if the user is not ready to accept the policy or warning summary, stop. If workspace is missing,
665
+ follow D.7.
666
+
667
+ Optional explanation: channel join may pay a Join Toll directly from the Ethereum account. Omitting `--account` uses a
668
+ MetaMask-compatible browser wallet for L1 signing without importing the raw L1 private key into the CLI.
669
+
670
+ ### D.9 Discover wallet name
671
+
672
+ Goal: find local wallet names without asking the user to inspect filesystem paths.
673
+
674
+ When to use: the guide needs a wallet selector or the selected wallet name is malformed.
675
+
676
+ Minimal user actions: run one local discovery command.
677
+
678
+ AI may ask: network and channel name if known.
679
+
680
+ AI must not ask: wallet secrets, key files, private keys, seed phrases, or filesystem screenshots containing secrets.
681
+
682
+ Command template:
683
+
684
+ ```bash
685
+ private-state-cli wallet list --network <NETWORK>
686
+ ```
687
+
688
+ Success check: the output lists wallet names that can be reused with `--wallet`.
689
+
690
+ Failure recovery: if no wallet exists, continue with D.5 and D.8 when the user needs to join.
691
+
692
+ Optional explanation: wallet names are local CLI identifiers, not secret values.
693
+
694
+ ### D.10 Fund bridge
695
+
696
+ Goal: deposit funds into the shared bridge vault only when the joined wallet needs liquidity.
697
+
698
+ When to use: the wallet is joined and no bridge, channel, or unused-note balance is available.
699
+
700
+ Minimal user actions: review the public warning summary, then run the deposit command.
701
+
702
+ AI may ask: amount, network, and account alias.
703
+
704
+ AI must not ask: private keys, wallet secrets, seed phrases, or provider credentials.
705
+
706
+ Command template:
707
+
708
+ ```bash
709
+ private-state-cli account deposit-bridge --amount <TOKENS> --network <NETWORK> --account <ACCOUNT>
710
+ ```
711
+
712
+ Success check:
713
+
714
+ ```bash
715
+ private-state-cli account get-bridge-fund --account <ACCOUNT> --network <NETWORK> --json
716
+ ```
717
+
718
+ Failure recovery: if the user is not ready after reading the warning summary, stop. If RPC or account is missing, return
719
+ to D.3 or D.4.
720
+
721
+ Optional explanation: bridge funding is public and does not create private notes by itself.
722
+
723
+ ### D.11 Fund channel
724
+
725
+ Goal: move already-bridged funds into channel accounting for the joined wallet.
726
+
727
+ When to use: bridge balance exists but channel balance is zero.
728
+
729
+ Minimal user actions: review the public/private warning summary, then run one channel deposit command.
730
+
731
+ AI may ask: wallet name, network, and amount.
732
+
733
+ AI must not ask: wallet secrets, private keys, seed phrases, or provider credentials.
734
+
735
+ Command template:
736
+
737
+ ```bash
738
+ private-state-cli wallet deposit-channel --wallet <WALLET> --network <NETWORK> --amount <TOKENS>
739
+ ```
740
+
741
+ Success check:
742
+
743
+ ```bash
744
+ private-state-cli wallet get-channel-fund --wallet <WALLET> --network <NETWORK> --json
745
+ ```
746
+
747
+ Failure recovery: if bridge balance is missing, follow D.10. If the user is not ready after reading the warning summary,
748
+ stop.
749
+
750
+ Optional explanation: channel funding prepares balance for note minting; it is separate from bridge funding.
751
+
752
+ ### D.12 Mint notes
753
+
754
+ Goal: create spendable private notes from channel balance.
755
+
756
+ When to use: channel balance exists and unused note count is zero or insufficient.
757
+
758
+ Minimal user actions: choose note amounts, review the warning summary, then run mint.
759
+
760
+ AI may ask: wallet name, network, amounts JSON, optional transaction submitter account, and explicit confirmation.
761
+
762
+ AI must not ask: wallet secrets, private keys, seed phrases, or note plaintext beyond what the command requires.
763
+
764
+ Command template:
765
+
766
+ ```bash
767
+ private-state-cli wallet mint-notes --wallet <WALLET> --network <NETWORK> --amounts <JSON_ARRAY>
768
+ ```
769
+
770
+ Success check:
771
+
772
+ ```bash
773
+ private-state-cli wallet get-notes --wallet <WALLET> --network <NETWORK> --json
774
+ ```
775
+
776
+ Failure recovery: if channel balance is missing, follow D.11. If the user is not ready after reading the warning summary,
777
+ stop.
778
+
779
+ Optional explanation: minting turns channel balance into notes that can later be transferred or redeemed.
780
+
781
+ ### D.13 Use notes
782
+
783
+ Goal: transfer or redeem existing notes without assuming the required notes exist.
784
+
785
+ When to use: the wallet has unused notes.
786
+
787
+ Minimal user actions: inspect notes, choose note IDs and recipients/amounts, review the warning summary, then run the
788
+ selected note command.
789
+
790
+ AI may ask: wallet name, network, selected note IDs, recipients, amounts, and optional transaction submitter account.
791
+
792
+ AI must not ask: wallet secrets, private keys, seed phrases, or unrelated note plaintext.
793
+
794
+ Command template:
795
+
796
+ ```bash
797
+ private-state-cli wallet get-notes --wallet <WALLET> --network <NETWORK> --json
798
+ ```
799
+
800
+ Success check: selected note IDs exist in the unused note list before transfer or redeem.
801
+
802
+ Failure recovery: if needed notes do not exist, guide funding, channel deposit, and minting instead of fabricating note
803
+ IDs or changing the user's intended transfer.
804
+
805
+ Optional explanation: confidential note transfers use notes owned by channel-local addresses registered in the
806
+ channel.
807
+
808
+ ### D.14 Exit channel
809
+
810
+ Goal: exit only when channel state allows it.
811
+
812
+ When to use: the wallet has zero channel balance and no state that prevents exit.
813
+
814
+ Minimal user actions: confirm they intend to exit, then run the exit command.
815
+
816
+ AI may ask: wallet name, network, and confirmation of intent.
817
+
818
+ AI must not ask: wallet secrets, private keys, seed phrases, or provider credentials.
819
+
820
+ Command template:
821
+
822
+ ```bash
823
+ private-state-cli channel exit --wallet <WALLET> --network <NETWORK>
824
+ ```
825
+
826
+ Success check: `wallet get-meta` reflects the updated lifecycle state.
827
+
828
+ Failure recovery: if balances or notes remain, resolve them before exit.
829
+
830
+ Optional explanation: exit is allowed only when the wallet state satisfies CLI and bridge contract requirements.
831
+
832
+ ### D.15 Handle abandoned Channel operation
833
+
834
+ Goal: avoid new joins and channel deposits after a Channel has been abandoned while keeping existing user exit paths
835
+ available.
836
+
837
+ When to use: `help guide --json`, `channel get-meta --json`, or a command warning reports
838
+ `channelOperation.isAbandoned: true`.
839
+
840
+ Minimal user actions: inspect channel metadata once, then avoid `channel join` and `wallet deposit-channel` for that
841
+ Channel. Existing registered users may continue note activity, `wallet redeem-notes`, `wallet withdraw-channel`, and
842
+ `channel exit` when ordinary balance, proof, and secret requirements are met.
843
+
844
+ AI may ask: whether the user is already registered in the Channel and which remaining action they intend to take.
845
+
846
+ AI must not ask: wallet secrets, private keys, seed phrases, note plaintext, or any data that would imply the Channel
847
+ leader can recover or inspect user notes.
848
+
849
+ Command template:
850
+
851
+ ```bash
852
+ private-state-cli channel get-meta --channel-name <CHANNEL> --network <NETWORK> --json
853
+ ```
854
+
855
+ Success check: `channelOperation.isAbandoned` confirms the current on-chain status.
856
+
857
+ Failure recovery: for unregistered users, stop instead of suggesting join. For existing users, choose only an allowed
858
+ next action: inspect notes, redeem notes, withdraw channel balance, exit, or withdraw bridge balance.
859
+
860
+ Optional explanation: Channel Operation Abandonment is a public Channel status. It stops onboarding and new channel
861
+ deposits; it is not custody, recovery, note inspection, exchange control, or user-level blocking.
862
+
863
+ ## E. User Confirmation And Policy
864
+
865
+ ### E.1 Warning summary review
866
+
867
+ Goal: ensure the user understands externally visible effects before transaction-sending commands.
868
+
869
+ When to use: before any command that sends a transaction, moves funds, creates or consumes notes, exports sensitive data,
870
+ or deletes local data.
871
+
872
+ Minimal user actions: read the CLI warning summary and decide whether to continue.
873
+
874
+ AI may ask: whether the user wants to continue after reading the warning summary.
875
+
876
+ AI must not ask: secrets, private keys, wallet secrets, seed phrases, or blanket future approval.
877
+
878
+ Command template: use the command returned by `help guide --json` or the relevant recipe without adding legal
879
+ confirmation flags.
880
+
881
+ Success check: the user runs the command directly after reviewing the warning summary.
882
+
883
+ Failure recovery: if the user is not ready to continue, stop. Do not accept Terms, confirm destructive prompts, or submit
884
+ confirmation text for the user.
885
+
886
+ Optional explanation: warning summaries may cover public events, fund movement, Channel policy, sensitive exports, or
887
+ wallet-state changes.
888
+
889
+ ### E.2 Channel policy confirmation
890
+
891
+ Goal: ensure channel create/join happens only after policy review.
892
+
893
+ When to use: before `channel create` or first `channel join`.
894
+
895
+ Minimal user actions: review the channel policy and confirm acceptance.
896
+
897
+ AI may ask: whether the user accepts the current channel policy and Join Toll impact.
898
+
899
+ AI must not ask: secrets or credentials.
900
+
901
+ Command template:
902
+
903
+ ```bash
904
+ private-state-cli channel join --channel-name <CHANNEL> --network <NETWORK> --account <ACCOUNT> --wallet-secret-path ./wallet-secret.txt
905
+ ```
906
+
907
+ Success check: the user runs the command only after reading the Channel policy.
908
+
909
+ Failure recovery: if any policy field is unexpected, stop and do not join or create the channel.
910
+
911
+ Optional explanation: channel policy is immutable after creation or acceptance; later fixes require a new channel or
912
+ migration.
913
+
914
+ ### E.3 Terms and safety context
915
+
916
+ Goal: ensure the user receives the legal and safety context that applies to the next action.
917
+
918
+ When to use: every `help guide --json` result that includes `agentGuidance.termsRefs`.
919
+
920
+ Minimal user actions: read the short explanation and decide whether to continue.
921
+
922
+ AI may ask: whether the user wants a plain-language summary of the referenced Terms sections.
923
+
924
+ AI must not ask: the user to accept Terms through JSON mode, delegate Terms acceptance, share secrets, or waive future
925
+ warnings.
926
+
927
+ Command template: no command is required by this item alone.
928
+
929
+ Success check: before suggesting the next command, explain the relevant public/private boundary, prohibited-use limits,
930
+ Self-Custody, no recovery method, Third-Party Service risk, no professional advice, no warranties, liability limits,
931
+ public observer limits, and the rule that User-Controlled AI Agents cannot accept Terms or confirmations.
932
+
933
+ Failure recovery: if the user has not reviewed or accepted required Terms, stop and direct the user to the interactive
934
+ CLI flow. Do not continue through JSON mode.
935
+
936
+ Optional explanation: `agentGuidance.termsRefs` contains Terms section numbers, not the full legal text. Read those
937
+ sections from `docs/dapps/private-state/terms.md` before advising the user.
938
+
939
+ ## F. Recovery Rules
940
+
941
+ ### F.1 Prefer mirror before genesis replay
942
+
943
+ Goal: recover channel workspace through the fastest compatible safe path.
944
+
945
+ When to use: local channel workspace is missing or unusable.
946
+
947
+ Minimal user actions: try registered mirror recovery first when available.
948
+
949
+ AI may ask: channel name and network.
950
+
951
+ AI must not ask: private keys, wallet secrets, seed phrases, or provider credentials.
952
+
953
+ Command template:
954
+
955
+ ```bash
956
+ private-state-cli channel recover-workspace --channel-name <CHANNEL> --network <NETWORK> --source mirror
957
+ ```
958
+
959
+ Success check: `help guide --network <NETWORK> --channel-name <CHANNEL> --json` no longer reports missing workspace.
960
+
961
+ Failure recovery: if no compatible mirror exists, use F.3 before suggesting RPC genesis replay.
962
+
963
+ Optional explanation: mirror recovery avoids replaying all channel logs from genesis when a compatible mirror exists.
964
+
965
+ ### F.2 Slow recovery triage
966
+
967
+ Goal: improve slow recovery by checking RPC provider scan limits before explaining internals.
968
+
969
+ When to use: channel or wallet recovery is unexpectedly slow.
970
+
971
+ Minimal user actions: inspect or reconfigure the saved RPC provider.
972
+
973
+ AI may ask: current provider, whether the user can use Ankr, or documented scan limits for an unlisted provider.
974
+
975
+ AI must not ask: provider passwords, dashboard access, private keys, wallet secrets, or seed phrases.
976
+
977
+ Command template:
978
+
979
+ ```bash
980
+ private-state-cli set rpc --network <NETWORK> --rpc-url <URL> --provider ankr
981
+ ```
982
+
983
+ Success check: subsequent recovery progress shows better scan rate or larger log chunks.
984
+
985
+ Failure recovery: if Ankr cannot be used, follow C.5 with documented provider limits.
986
+
987
+ Optional explanation: recovery speed is dominated by `eth_getLogs` request rate and block range cap.
988
+
989
+ ### F.3 Genesis replay warning
990
+
991
+ Goal: use RPC genesis replay only as an explicit slow fallback.
992
+
993
+ When to use: no compatible workspace mirror is available.
994
+
995
+ Minimal user actions: confirm they understand genesis replay can take much longer, then run the explicit command.
996
+
997
+ AI may ask: confirmation that no compatible mirror exists and that the user accepts slow replay.
998
+
999
+ AI must not ask: secrets or credentials.
1000
+
1001
+ Command template:
1002
+
1003
+ ```bash
1004
+ private-state-cli channel recover-workspace --channel-name <CHANNEL> --network <NETWORK> --source rpc --from-genesis
1005
+ ```
1006
+
1007
+ Success check: guide no longer reports missing local channel workspace.
1008
+
1009
+ Failure recovery: if RPC fails or is too slow, revisit C.2, C.4, C.5, and F.2.
1010
+
1011
+ Optional explanation: genesis replay scans public channel logs from the channel creation block.
1012
+
1013
+ ### F.4 Use CLI recovery hints first
1014
+
1015
+ Goal: follow the CLI's own corrective guidance before inventing a recovery sequence.
1016
+
1017
+ When to use: any CLI command fails, especially bridge-facing, workspace recovery, wallet recovery, and proof-backed
1018
+ commands.
1019
+
1020
+ Minimal user actions: share or let the AI read the command's stdout/stderr result, then run the first applicable `Try:`
1021
+ hint or error-specific corrective command.
1022
+
1023
+ AI may ask: the failed command, selected network, channel name, account alias, wallet name, and whether the user wants
1024
+ the AI to run the printed corrective command.
1025
+
1026
+ AI must not ask: private keys, wallet secrets, seed phrases, provider passwords, dashboard access, or secret file
1027
+ contents.
1028
+
1029
+ Command template:
1030
+
1031
+ ```bash
1032
+ private-state-cli help guide --network <NETWORK> --channel-name <CHANNEL> --account <ACCOUNT> --wallet <WALLET> --json
1033
+ ```
1034
+
1035
+ Success check: the follow-up command resolves the failure or returns a more specific CLI error with a new `Try:` hint.
1036
+
1037
+ Failure recovery: if the printed hints conflict with the user's stated intent or require a destructive/public action,
1038
+ stop and ask for confirmation before proceeding.
1039
+
1040
+ Optional explanation: CLI errors are intentionally written with recovery hints; prefer them over ad hoc filesystem
1041
+ inspection or command-shape changes.
1042
+
1043
+ ### F.5 Stale proof recovery
1044
+
1045
+ Goal: recover from stale workspace or stale proof failures without changing the user's intended transaction.
1046
+
1047
+ When to use: a proof-backed command fails because channel state changed, local workspace state is stale, or the CLI
1048
+ reports a stale root/proof condition.
1049
+
1050
+ Minimal user actions: refresh the relevant channel or wallet state, re-check notes/balances if needed, then rerun the
1051
+ original intended command unchanged.
1052
+
1053
+ AI may ask: network, channel name, wallet name, account alias, original command, and confirmation to rerun the original
1054
+ command after refresh.
1055
+
1056
+ AI must not ask: wallet secrets, private keys, seed phrases, or permission to silently change recipients, amounts, note
1057
+ counts, or function shape.
1058
+
1059
+ Command template:
1060
+
1061
+ ```bash
1062
+ private-state-cli channel recover-workspace --channel-name <CHANNEL> --network <NETWORK>
1063
+ private-state-cli wallet get-notes --wallet <WALLET> --network <NETWORK> --json
1064
+ ```
1065
+
1066
+ Success check: the refreshed workspace and wallet state still support the original intended command; rerunning it
1067
+ regenerates a proof from fresh state.
1068
+
1069
+ Failure recovery: if the original notes or balances are no longer usable after refresh, ask the user to choose a new
1070
+ plan. Do not substitute a different transfer or redeem shape silently.
1071
+
1072
+ Optional explanation: stale proof recovery is about refreshing state and regenerating the proof, not changing the
1073
+ transaction semantics.
1074
+
1075
+ ### F.6 UnexpectedCurrentRootVector handling
1076
+
1077
+ Goal: classify `UnexpectedCurrentRootVector()` as stale channel-root or stale-proof state, not as a command-shape bug.
1078
+
1079
+ When to use: a dry-run or submit failure includes `UnexpectedCurrentRootVector()`.
1080
+
1081
+ Minimal user actions: refresh channel workspace state, re-check affected wallet notes and balances, then rerun the
1082
+ original intended command unchanged if still valid.
1083
+
1084
+ AI may ask: original command, network, channel name, wallet name, and confirmation before rerunning.
1085
+
1086
+ AI must not ask: permission to change recipients, amounts, note counts, function arity, or split a transfer as a
1087
+ workaround unless the refreshed state proves the original plan is no longer possible and the user chooses a new plan.
1088
+
1089
+ Command template:
1090
+
1091
+ ```bash
1092
+ private-state-cli channel recover-workspace --channel-name <CHANNEL> --network <NETWORK>
1093
+ private-state-cli wallet get-notes --wallet <WALLET> --network <NETWORK> --json
1094
+ ```
1095
+
1096
+ Success check: the original command either succeeds after proof regeneration or fails with a different actionable CLI
1097
+ error.
1098
+
1099
+ Failure recovery: if the same error repeats after refresh, follow F.4 and inspect CLI hints before changing the user's
1100
+ transaction plan.
1101
+
1102
+ Optional explanation: this error means the proof was built against an older channel root; changing command shape can
1103
+ hide the real state-refresh problem and may violate the user's intent.
1104
+
1105
+ ## G. Note Workflow Rules
1106
+
1107
+ ### G.1 Bridge funding is public
1108
+
1109
+ Goal: keep bridge funding guidance accurate before note workflows.
1110
+
1111
+ When to use: bridge balance is missing or the guide recommends bridge deposit.
1112
+
1113
+ Minimal user actions: choose amount, review the warning summary, and run the bridge deposit command.
1114
+
1115
+ AI may ask: amount, network, and account alias.
1116
+
1117
+ AI must not ask: private keys, wallet secrets, seed phrases, or provider credentials.
1118
+
1119
+ Command template:
1120
+
1121
+ ```bash
1122
+ private-state-cli account deposit-bridge --amount <TOKENS> --network <NETWORK> --account <ACCOUNT>
1123
+ ```
1124
+
1125
+ Success check: `account get-bridge-fund --json` shows available bridge balance.
1126
+
1127
+ Failure recovery: if account or RPC is missing, follow D.4 or D.3.
1128
+
1129
+ Optional explanation: bridge deposits and withdrawals expose the Ethereum account, vault, amount, and transaction hashes.
1130
+
1131
+ ### G.2 Channel funding is separate
1132
+
1133
+ Goal: move bridge funds into channel accounting only after wallet join.
1134
+
1135
+ When to use: bridge balance exists but channel balance is zero.
1136
+
1137
+ Minimal user actions: choose amount, review the warning summary, and run channel deposit.
1138
+
1139
+ AI may ask: amount, wallet name, and network.
1140
+
1141
+ AI must not ask: wallet secrets, private keys, seed phrases, or provider credentials.
1142
+
1143
+ Command template:
1144
+
1145
+ ```bash
1146
+ private-state-cli wallet deposit-channel --wallet <WALLET> --network <NETWORK> --amount <TOKENS>
1147
+ ```
1148
+
1149
+ Success check: `wallet get-channel-fund --json` shows channel balance.
1150
+
1151
+ Failure recovery: if bridge balance is missing, follow G.1.
1152
+
1153
+ Optional explanation: channel funding does not happen automatically when bridge funds are deposited.
1154
+
1155
+ ### G.3 Minting creates spendable private notes
1156
+
1157
+ Goal: create notes only after channel balance exists.
1158
+
1159
+ When to use: the wallet has channel balance and no usable notes.
1160
+
1161
+ Minimal user actions: choose amounts, review the warning summary, and run mint.
1162
+
1163
+ AI may ask: amounts JSON, wallet name, network, and optional transaction submitter.
1164
+
1165
+ AI must not ask: wallet secrets, private keys, seed phrases, or unrelated note plaintext.
1166
+
1167
+ Command template:
1168
+
1169
+ ```bash
1170
+ private-state-cli wallet mint-notes --wallet <WALLET> --network <NETWORK> --amounts <JSON_ARRAY>
1171
+ ```
1172
+
1173
+ Success check: `wallet get-notes --json` shows unused notes.
1174
+
1175
+ Failure recovery: if channel balance is missing, follow G.2.
1176
+
1177
+ Optional explanation: minted notes are the spendable private-state units for transfer or redeem.
1178
+
1179
+ ### G.4 Transfer and redeem require existing notes
1180
+
1181
+ Goal: prevent fabricated transfers by checking available notes first.
1182
+
1183
+ When to use: the user wants to transfer or redeem notes.
1184
+
1185
+ Minimal user actions: inspect notes, select existing note IDs, then confirm the intended transfer or redeem command.
1186
+
1187
+ AI may ask: selected note IDs, recipients, amounts, wallet name, network, and optional transaction submitter.
1188
+
1189
+ AI must not ask: wallet secrets, private keys, seed phrases, or unrelated note plaintext.
1190
+
1191
+ Command template:
1192
+
1193
+ ```bash
1194
+ private-state-cli wallet get-notes --wallet <WALLET> --network <NETWORK> --json
1195
+ ```
1196
+
1197
+ Success check: selected note IDs exist and have enough value for the intended action.
1198
+
1199
+ Failure recovery: if notes are missing, follow G.1, G.2, and G.3 instead of changing recipients, amounts, or command
1200
+ shape without user approval.
1201
+
1202
+ Optional explanation: note transfers use existing note commitments; the CLI cannot spend notes that do not exist in the
1203
+ wallet.
1204
+
1205
+ ### G.5 Transaction submitter option
1206
+
1207
+ Goal: explain optional transaction-submission privacy without changing ownership semantics.
1208
+
1209
+ When to use: proof-backed commands such as mint, transfer, or redeem may use a separate Ethereum submitter account or a
1210
+ browser wallet for the L1 `executeChannelTransaction` submission.
1211
+
1212
+ Minimal user actions: decide whether to use the wallet owner, a separate imported local account, or a browser wallet for
1213
+ gas submission.
1214
+
1215
+ AI may ask: submitter account alias if the user wants a local submitter account.
1216
+
1217
+ AI must not ask: private keys, wallet secrets, seed phrases, or submitter private key contents.
1218
+
1219
+ Local submitter command template:
1220
+
1221
+ ```bash
1222
+ private-state-cli wallet transfer-notes --wallet <WALLET> --network <NETWORK> --note-ids <JSON_ARRAY> --recipients <JSON_ARRAY> --amounts <JSON_ARRAY> --tx-submitter <ACCOUNT>
1223
+ ```
1224
+
1225
+ Browser-wallet submitter command template:
1226
+
1227
+ ```bash
1228
+ private-state-cli wallet transfer-notes --wallet <WALLET> --network <NETWORK> --note-ids <JSON_ARRAY> --recipients <JSON_ARRAY> --amounts <JSON_ARRAY> --tx-submitter
1229
+ ```
1230
+
1231
+ Success check: the command accepts the submitter selector and submits `executeChannelTransaction` with the selected L1
1232
+ submitter.
1233
+
1234
+ Failure recovery: if a local submitter account is missing, import it with B.1 through B.3, omit `--tx-submitter`, or pass
1235
+ `--tx-submitter` without a value to use browser-wallet submission.
1236
+
1237
+ Optional explanation: the wallet owner still proves note ownership; the submitter only submits the on-chain transaction
1238
+ and pays gas. Browser-wallet submission does not replace local L2 spending/viewing keys.
1239
+
1240
+ ### G.6 Exit safety
1241
+
1242
+ Goal: avoid channel exit while remaining balances or state make exit unsafe or invalid.
1243
+
1244
+ When to use: the guide recommends or the user asks for channel exit.
1245
+
1246
+ Minimal user actions: inspect balances and confirm intent.
1247
+
1248
+ AI may ask: wallet name, network, and exit confirmation.
1249
+
1250
+ AI must not ask: secrets or credentials.
1251
+
1252
+ Command template:
1253
+
1254
+ ```bash
1255
+ private-state-cli wallet get-channel-fund --wallet <WALLET> --network <NETWORK> --json
1256
+ ```
1257
+
1258
+ Success check: channel balance and related state allow exit before running `channel exit`.
1259
+
1260
+ Failure recovery: if balance remains, transfer, redeem, withdraw, or otherwise resolve state before exit.
1261
+
1262
+ Optional explanation: exit rules protect bridge and wallet accounting consistency.
1263
+
1264
+ ## H. Discovery Commands
1265
+
1266
+ ### H.1 State discovery
1267
+
1268
+ Goal: discover local and on-chain state through CLI commands instead of filesystem inspection.
1269
+
1270
+ When to use: selectors are missing, wallet name is unknown, balances are unclear, or the guide asks for more state.
1271
+
1272
+ Minimal user actions: run the smallest read-only command that answers the current question.
1273
+
1274
+ AI may ask: network, channel name, account alias, or wallet name.
1275
+
1276
+ AI must not ask: secrets, private keys, wallet secrets, seed phrases, or secret file contents.
1277
+
1278
+ Command template:
1279
+
1280
+ ```bash
1281
+ private-state-cli help guide --network <NETWORK> --channel-name <CHANNEL> --account <ACCOUNT> --wallet <WALLET> --json
1282
+ private-state-cli wallet list --network <NETWORK>
1283
+ private-state-cli wallet get-meta --wallet <WALLET> --network <NETWORK>
1284
+ private-state-cli account get-bridge-fund --account <ACCOUNT> --network <NETWORK>
1285
+ private-state-cli wallet get-channel-fund --wallet <WALLET> --network <NETWORK>
1286
+ ```
1287
+
1288
+ Success check: the command returns the public selector, metadata, or balance needed for the next step.
1289
+
1290
+ Failure recovery: if a selector is unknown, start with `help guide --network <NETWORK> --json` and add selectors as they
1291
+ become known.
1292
+
1293
+ Optional explanation: these commands are read-only discovery commands; they should be preferred over manual folder
1294
+ inspection.
1295
+
1296
+ ### H.2 JSON command output handling
1297
+
1298
+ Goal: parse CLI JSON mode correctly without treating progress or warnings as fatal results.
1299
+
1300
+ When to use: the AI runs any `private-state-cli ... --json` command on behalf of the user.
1301
+
1302
+ Minimal user actions: none beyond authorizing the command when needed.
1303
+
1304
+ AI may ask: whether to proceed with a transaction-sending command.
1305
+
1306
+ AI must not ask: the user to manually parse JSONL progress events or reveal secrets from logs.
1307
+
1308
+ Command template:
1309
+
1310
+ ```bash
1311
+ private-state-cli <COMMAND> ... --json
1312
+ ```
1313
+
1314
+ Success check: stdout contains the final JSON success or failure result. In JSON mode, stderr may contain JSON Lines for
1315
+ progress, warning, or informational events; summarize them for the user instead of treating them as the final result.
1316
+
1317
+ Failure recovery: if stdout contains `{ "ok": false, ... }`, read the error and any `Try:` hints, then follow F.4.
1318
+
1319
+ Optional explanation: JSON mode separates machine-readable final results on stdout from streaming progress events on
1320
+ stderr.
1321
+
1322
+ ### H.3 Fee and cost questions
1323
+
1324
+ Goal: answer gas, transaction fee, transaction cost, or USD cost questions from the CLI's measured fee report.
1325
+
1326
+ When to use: the user asks about gas use, transaction fees, transaction cost, or USD cost for private-state CLI
1327
+ commands.
1328
+
1329
+ Minimal user actions: choose the network if it is unclear.
1330
+
1331
+ AI may ask: network.
1332
+
1333
+ AI must not ask: private keys, wallet secrets, seed phrases, provider passwords, or wallet balances unless a separate
1334
+ balance question requires a read-only balance command.
1335
+
1336
+ Command template:
1337
+
1338
+ ```bash
1339
+ private-state-cli help transaction-fees --network <NETWORK> --json
1340
+ ```
1341
+
1342
+ Success check: the result contains `rows`; answer from those rows instead of guessing.
1343
+
1344
+ Failure recovery: if the network is unclear, ask which network to use. If the command fails, follow F.4 and the printed
1345
+ CLI corrective guidance before escalating.
1346
+
1347
+ Optional explanation: fee estimates combine packaged measured gas data with live network fee data and ETH/USD pricing.
1348
+
1349
+ ### H.4 Command result recovery discipline
1350
+
1351
+ Goal: avoid inventing alternate workflows when the CLI already reports a precise correction.
1352
+
1353
+ When to use: any command returns an error, warning, or partial progress that the user asks about.
1354
+
1355
+ Minimal user actions: let the AI inspect the exact command result and run the smallest corrective command.
1356
+
1357
+ AI may ask: public selectors needed by the printed hint, and confirmation before transaction-sending or destructive
1358
+ actions.
1359
+
1360
+ AI must not ask: secrets, seed phrases, wallet secrets, private keys, provider passwords, or broad approval to change the
1361
+ workflow.
1362
+
1363
+ Command template:
1364
+
1365
+ ```bash
1366
+ private-state-cli help guide --network <NETWORK> --channel-name <CHANNEL> --account <ACCOUNT> --wallet <WALLET> --json
1367
+ ```
1368
+
1369
+ Success check: the next command follows CLI hints, `help guide --json`, or an indexed recipe in this file.
1370
+
1371
+ Failure recovery: if multiple corrective paths are possible, explain the smallest safe path and ask the user to choose
1372
+ only when the choice changes public actions, cost, recovery time, or privacy implications.
1373
+
1374
+ Optional explanation: the agent should prefer CLI-authored recovery paths because they are aligned with current command
1375
+ behavior and local state checks.
1376
+
1377
+ ## I. Plain-Language Explanations
1378
+
1379
+ ### I.1 Private key source file
1380
+
1381
+ Goal: explain private key source files only when useful for the next action.
1382
+
1383
+ When to use: the user asks what the file is, appears confused, or must decide whether to create/use a source file.
1384
+
1385
+ Minimal user actions: no extra action unless B.1 or B.2 is needed.
1386
+
1387
+ AI may ask: whether the user wants to proceed with the default helper command.
1388
+
1389
+ AI must not ask: private key contents, seed phrase, wallet password, or screenshots showing secrets.
1390
+
1391
+ Command template:
1392
+
1393
+ ```bash
1394
+ private-state-cli secret create-private-key-source --output ./ethereum-private-key.txt
1395
+ ```
1396
+
1397
+ Success check: the user understands enough to run B.1 without revealing the key in chat.
1398
+
1399
+ Failure recovery: if the user is still unsure, explain that the CLI reads the source once during import and then uses a
1400
+ protected local account alias.
1401
+
1402
+ Optional explanation: this is a local file containing the Ethereum private key for one-time import into the CLI.
1403
+
1404
+ ### I.2 Account nickname
1405
+
1406
+ Goal: explain account aliases only when the user needs to choose or use one.
1407
+
1408
+ When to use: before `account import`, `account get-l1-address`, bridge funding, or channel join.
1409
+
1410
+ Minimal user actions: choose a local account alias.
1411
+
1412
+ AI may ask: preferred account alias.
1413
+
1414
+ AI must not ask: private key contents, seed phrase, or wallet password.
1415
+
1416
+ Command template:
1417
+
1418
+ ```bash
1419
+ private-state-cli account import --account <ACCOUNT> --network <NETWORK> --private-key-file ./ethereum-private-key.txt
1420
+ ```
1421
+
1422
+ Success check: `account get-l1-address --json` returns the expected Ethereum address.
1423
+
1424
+ Failure recovery: if the alias already exists, verify it with B.3 before reusing it.
1425
+
1426
+ Optional explanation: after import, signing commands use `--account <ACCOUNT>` instead of asking for the private key.
1427
+
1428
+ ### I.3 Wallet secret source file
1429
+
1430
+ Goal: explain wallet secret source files only when useful for setup or recovery.
1431
+
1432
+ When to use: before wallet secret creation, channel join, or spending-key recovery.
1433
+
1434
+ Minimal user actions: run B.4 or preserve an existing local source file.
1435
+
1436
+ AI may ask: whether to use the default path or an existing local path.
1437
+
1438
+ AI must not ask: wallet secret contents, private key contents, seed phrase, or password/passphrase contents.
1439
+
1440
+ Command template:
1441
+
1442
+ ```bash
1443
+ private-state-cli secret create-wallet-secret-source --output ./wallet-secret.txt
1444
+ ```
1445
+
1446
+ Success check: the user can proceed to B.6 or B.7 without revealing the secret.
1447
+
1448
+ Failure recovery: if the user lost the source and protected key material, explain the recovery limitation and avoid
1449
+ promising reconstruction.
1450
+
1451
+ Optional explanation: this is a separate user-kept secret used during channel join to derive channel-bound wallet
1452
+ authority; it is not the Ethereum private key.
1453
+
1454
+ ### I.4 RPC URL
1455
+
1456
+ Goal: explain RPC URLs only when needed for setup or troubleshooting.
1457
+
1458
+ When to use: RPC is missing, the user asks what an RPC URL is, or chain ID validation fails.
1459
+
1460
+ Minimal user actions: get the endpoint URL from a provider such as Ankr or from their own node.
1461
+
1462
+ AI may ask: endpoint URL and selected network.
1463
+
1464
+ AI must not ask: provider password, dashboard access, seed phrase, private key, wallet secret, or billing credentials.
1465
+
1466
+ Command template:
1467
+
1468
+ ```bash
1469
+ private-state-cli set rpc --network <NETWORK> --rpc-url <URL> --provider ankr
1470
+ ```
1471
+
1472
+ Success check: `help guide --network <NETWORK> --json` no longer reports missing RPC.
1473
+
1474
+ Failure recovery: if chain ID validation fails, use an endpoint for the selected network. If provider limits are unknown,
1475
+ follow C.5.
1476
+
1477
+ Optional explanation: an RPC URL is the provider endpoint the CLI uses to read chain state and send transactions. The CLI
1478
+ requires the user to configure one and does not have a default endpoint.