@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/CHANGELOG.md +94 -4
- package/README.md +230 -90
- package/agents.md +1476 -148
- package/assets/service-terms.md +294 -0
- package/assets/tx-fees.json +4 -4
- package/commands/account.mjs +5 -1
- package/commands/channel.mjs +14 -0
- package/commands/index.mjs +5 -0
- package/commands/notes.mjs +5 -0
- package/commands/secret.mjs +20 -0
- package/commands/system.mjs +7 -2
- package/commands/wallet.mjs +12 -2
- package/investigator/README.md +13 -11
- package/investigator/index.html +1 -1
- package/lib/private-state-browser-wallet-helpers.mjs +91 -0
- package/lib/private-state-cli-command-registry.mjs +222 -97
- package/lib/private-state-runtime-management.mjs +90 -10
- package/lib/private-state-terms.mjs +35 -0
- package/lib/runtime.mjs +3493 -399
- package/package.json +3 -3
- package/private-state-bridge-cli.mjs +1 -1
- package/cli-assistant.html +0 -1534
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
# Tonigma Terms of Service
|
|
2
|
+
|
|
3
|
+
Last updated: June 16, 2026
|
|
4
|
+
|
|
5
|
+
## 1. Definitions
|
|
6
|
+
|
|
7
|
+
For purposes of these Terms:
|
|
8
|
+
|
|
9
|
+
- **Terms** means these Terms of Service.
|
|
10
|
+
- **Service** means Tonigma, the Private-State DApp, related Bridge workflows, official software, official interfaces,
|
|
11
|
+
official documentation, and related materials made available by the Provider.
|
|
12
|
+
- **Tonigma** means the branded user-facing name for Tokamak Private App Channels.
|
|
13
|
+
- **Channel** means an opt-in Tonigma application environment with its own policy, membership rules, accounting records,
|
|
14
|
+
and Private Note records.
|
|
15
|
+
- **Join Toll** means a Channel entry charge paid when a user joins a Channel.
|
|
16
|
+
- **Ethereum mainnet** means the public Ethereum network.
|
|
17
|
+
- **TON** means the token used with relevant Service workflows. These Terms do not state that TON itself becomes
|
|
18
|
+
private, anonymous, or untraceable.
|
|
19
|
+
- **Ethereum Account** means the user's externally controlled Ethereum wallet account.
|
|
20
|
+
- **Self-Custody** means that the user, not the Provider or Provider Parties, controls wallet access, keys, secret
|
|
21
|
+
material, and transaction decisions.
|
|
22
|
+
- **Private Note** means a Channel-local private application record. A Private Note is not a separate asset that an
|
|
23
|
+
exchange can receive as a deposit.
|
|
24
|
+
- **Bridge** means the Ethereum mainnet smart-contract path through which public deposits, withdrawals, and related
|
|
25
|
+
accounting updates are recorded.
|
|
26
|
+
- **Provider** means Jehyuk Jang, the individual who officially makes the Service available. The Provider's public
|
|
27
|
+
privacy and notice contact is `cjhyuck213@gmail.com`. The Provider's stated jurisdiction is Singapore.
|
|
28
|
+
- **Provider Parties** means the Provider and the Provider's affiliates, contractors, agents, service providers, and
|
|
29
|
+
authorized representatives, to the extent each acts within an authorized Service-related role.
|
|
30
|
+
- **Third-Party Services** means wallets, RPC providers, exchanges, explorers, analytics providers, browsers, software
|
|
31
|
+
distribution services, operating systems, cloud services, and other services not controlled by Provider Parties.
|
|
32
|
+
- **Privacy Notice** means the Provider's published privacy notice for the Service.
|
|
33
|
+
|
|
34
|
+
## 2. Service Scope And Product Boundary
|
|
35
|
+
|
|
36
|
+
These Terms govern access to and use of the Service.
|
|
37
|
+
|
|
38
|
+
Tonigma is an opt-in private application-channel system used from a Self-Custody Ethereum Account. A Channel is not an
|
|
39
|
+
exchange deposit or withdrawal network. A Private Note is not an exchange-depositable asset.
|
|
40
|
+
|
|
41
|
+
Tonigma does not alter TON transfer rules on Ethereum mainnet. Provider Parties do not provide exchange deposit services,
|
|
42
|
+
exchange withdrawal services, brokerage, custodial wallet services, hosted transfer services, asset recovery services,
|
|
43
|
+
compliance services, or tax services.
|
|
44
|
+
|
|
45
|
+
The Service is made available as open software and public-good infrastructure. Provider Parties do not operate the
|
|
46
|
+
Service as a fee-generating custodial, brokerage, exchange, hosted transfer, or paid asset-management service.
|
|
47
|
+
|
|
48
|
+
Join Tolls paid through the Service must not be monetized by Provider Parties. Channel policy and official on-chain
|
|
49
|
+
records control any Join Toll refund or non-refund treatment. Any non-refunded Join Toll portion is not Provider Party
|
|
50
|
+
revenue.
|
|
51
|
+
|
|
52
|
+
Nothing in these Terms is a determination of the regulatory status of any person, entity, software, transaction, network,
|
|
53
|
+
token, or service under applicable law.
|
|
54
|
+
|
|
55
|
+
## 3. Acceptance And Eligibility
|
|
56
|
+
|
|
57
|
+
These Terms become effective for a user when the user accepts them through an official Service interface or another
|
|
58
|
+
acceptance method provided by the Provider.
|
|
59
|
+
|
|
60
|
+
If the user does not accept these Terms, the user must not access, install, or use the Service.
|
|
61
|
+
|
|
62
|
+
The user represents that the user has legal capacity to accept these Terms and to operate a self-custody wallet. If the
|
|
63
|
+
user acts for an organization, the user represents that the user has authority to bind that organization.
|
|
64
|
+
|
|
65
|
+
The user represents that use of the Service is not prohibited by laws applicable to the user.
|
|
66
|
+
|
|
67
|
+
## 4. Public Ethereum Mainnet Records
|
|
68
|
+
|
|
69
|
+
Ethereum mainnet transactions are public by design.
|
|
70
|
+
|
|
71
|
+
Bridge deposits, Bridge withdrawals, Channel joins, registrations, accounting updates, gas-paying accounts, transaction
|
|
72
|
+
submitters, transaction hashes, token amounts, timing, and related public records may be visible on Ethereum mainnet or
|
|
73
|
+
through services that index Ethereum mainnet.
|
|
74
|
+
|
|
75
|
+
The Service must not be used or described as a way to hide exchange-facing TON transfer records.
|
|
76
|
+
|
|
77
|
+
## 5. Private Application-State Limits
|
|
78
|
+
|
|
79
|
+
Tonigma is designed so public contract state does not, by itself, reconstruct some internal Private Note sender-recipient
|
|
80
|
+
relationships, Private Note plaintext, or Private Note provenance by default.
|
|
81
|
+
|
|
82
|
+
Tonigma does not make all user activity secret. Public records, metadata, timing, amounts, user behavior, Third-Party
|
|
83
|
+
Services, wallet software, browser behavior, user disclosure, or compromised devices may reveal information.
|
|
84
|
+
|
|
85
|
+
No privacy, anonymity, unlinkability, confidentiality, exchange acceptance, compliance result, legal result, tax result,
|
|
86
|
+
regulatory outcome, or third-party acceptance of the user's explanation of asset history is guaranteed.
|
|
87
|
+
|
|
88
|
+
## 6. Self-Custody, Secrets, And No Recovery Method
|
|
89
|
+
|
|
90
|
+
The Service is designed for Self-Custody use.
|
|
91
|
+
|
|
92
|
+
Provider Parties do not possess, control, store, or recover the user's Ethereum private keys, seed phrases, wallet
|
|
93
|
+
secrets, spending keys, viewing keys, source files, backup files, or Private Note plaintext.
|
|
94
|
+
|
|
95
|
+
The user is solely responsible for securing the user's devices, wallet software, files, backups, passwords, private
|
|
96
|
+
keys, seed phrases, wallet secrets, spending keys, viewing keys, and equivalent secret material.
|
|
97
|
+
|
|
98
|
+
If all required copies of a private key, seed phrase, wallet secret, spending key, viewing key, source file, backup file,
|
|
99
|
+
or other required recovery material are lost, no recovery method exists for the affected access, Private Notes, funds,
|
|
100
|
+
evidence, or disclosure capability.
|
|
101
|
+
|
|
102
|
+
Provider Parties, support channels, websites, automated tools, and third parties do not need the user's private keys,
|
|
103
|
+
seed phrases, wallet secrets, spending keys, viewing keys, or equivalent secrets to provide ordinary Service access,
|
|
104
|
+
support, explanations, or guidance.
|
|
105
|
+
|
|
106
|
+
The user must not share private keys, seed phrases, wallet secrets, spending keys, viewing keys, or equivalent secrets
|
|
107
|
+
with any automated tool, Provider Party, support channel, website, or third party.
|
|
108
|
+
|
|
109
|
+
## 7. Prohibited Use
|
|
110
|
+
|
|
111
|
+
The user must not use the Service for money laundering, terrorist financing, sanctions evasion, regulatory evasion,
|
|
112
|
+
illegal gambling, fraud, theft, ransomware, market manipulation, tax evasion, criminal-proceeds concealment,
|
|
113
|
+
exchange-monitoring evasion, unauthorized access, cybersecurity abuse, harassment, threats, abuse of any person,
|
|
114
|
+
infringement of intellectual-property, publicity, privacy, or data-protection rights, or any activity prohibited by
|
|
115
|
+
applicable law.
|
|
116
|
+
|
|
117
|
+
The user must not attempt to use Tonigma to make an unlawful transaction appear lawful or to conceal the source,
|
|
118
|
+
ownership, control, or destination of assets.
|
|
119
|
+
|
|
120
|
+
## 8. User Responsibilities
|
|
121
|
+
|
|
122
|
+
The user is solely responsible for determining whether the user's use of the Service is lawful.
|
|
123
|
+
|
|
124
|
+
The user is solely responsible for wallet selection, network selection, RPC selection, Channel selection, transaction
|
|
125
|
+
parameters, amounts, recipients, note selection, fees, failed transactions, wrong-network use, wrong-address use, and
|
|
126
|
+
irreversible confirmed transactions.
|
|
127
|
+
|
|
128
|
+
The user is solely responsible for preserving source files, wallet-secret files, backup files, evidence files,
|
|
129
|
+
transaction records, and disclosure material that the user may later need.
|
|
130
|
+
|
|
131
|
+
The user must review applicable Channel policy before joining a Channel and must use only trustworthy software, package
|
|
132
|
+
sources, websites, wallets, RPC providers, and devices.
|
|
133
|
+
|
|
134
|
+
## 9. Channel Policy
|
|
135
|
+
|
|
136
|
+
Joining a Channel means accepting that Channel's policy.
|
|
137
|
+
|
|
138
|
+
Channel policy may include Join Tolls, refund rules, administrative roles, monitoring practices, fee rules, availability
|
|
139
|
+
practices, or other operating rules.
|
|
140
|
+
|
|
141
|
+
Channel operators or service operators may publish public information, but they do not control the user's Ethereum
|
|
142
|
+
Account or user secrets and do not guarantee recovery of lost user secrets, lost Private Notes, lost evidence, failed
|
|
143
|
+
transactions, Third-Party Service failures, or rejected exchange deposits.
|
|
144
|
+
|
|
145
|
+
## 10. Public Monitoring And Evidence
|
|
146
|
+
|
|
147
|
+
Public blockchain records and public Channel records may be monitored by users, exchanges, analytics providers,
|
|
148
|
+
regulators, Channel operators, service operators, and other observers.
|
|
149
|
+
|
|
150
|
+
Public observer or indexing services may be delayed, incomplete, unavailable, misconfigured, inconsistent with a user's
|
|
151
|
+
local state, or insufficient for legal, accounting, tax, exchange, audit, or compliance review.
|
|
152
|
+
|
|
153
|
+
The user may need to preserve local evidence to explain asset history, transaction history, Private Note ownership, or
|
|
154
|
+
facts the user chooses to prove.
|
|
155
|
+
|
|
156
|
+
Selective disclosure depends on Service features and on records preserved by the user.
|
|
157
|
+
|
|
158
|
+
## 11. Third-Party Services
|
|
159
|
+
|
|
160
|
+
The Service may require or interact with Third-Party Services.
|
|
161
|
+
|
|
162
|
+
Provider Parties do not control Third-Party Services and are not responsible for their security, availability,
|
|
163
|
+
correctness, fees, privacy practices, data retention, terms, sanctions screening, account restrictions, transaction
|
|
164
|
+
policies, or failures.
|
|
165
|
+
|
|
166
|
+
The user is responsible for reviewing and complying with Third-Party Service terms.
|
|
167
|
+
|
|
168
|
+
## 12. Privacy And Data
|
|
169
|
+
|
|
170
|
+
Public blockchain records are public and may be copied, indexed, analyzed, or retained by any person.
|
|
171
|
+
|
|
172
|
+
Provider Parties may operate official interfaces that process logs, device information, network information, usage data,
|
|
173
|
+
contact information, or other data.
|
|
174
|
+
|
|
175
|
+
Provider Parties process certain data through official interfaces as described in the Privacy Notice. The current Privacy
|
|
176
|
+
Notice is published at [Tonigma Privacy Notice](https://github.com/tokamak-network/Tokamak-zk-EVM-contracts/blob/main/docs/dapps/private-state/privacy-notice.md).
|
|
177
|
+
|
|
178
|
+
Third-Party Services may collect or process user data under their own terms and privacy policies.
|
|
179
|
+
|
|
180
|
+
## 13. No Professional Advice
|
|
181
|
+
|
|
182
|
+
Provider Parties do not provide legal, tax, accounting, financial, investment, trading, compliance, sanctions, or
|
|
183
|
+
regulatory advice through the Service.
|
|
184
|
+
|
|
185
|
+
Information provided through the Service is for operational and informational purposes only.
|
|
186
|
+
|
|
187
|
+
Automated tools selected, configured, or used by the user are not agents, representatives, service providers, or support
|
|
188
|
+
providers of Provider Parties unless an official Service document expressly says otherwise.
|
|
189
|
+
|
|
190
|
+
Provider Parties do not control and are not responsible for automated tools selected, configured, or used by the user.
|
|
191
|
+
|
|
192
|
+
The user is responsible for reviewing any recommendation, explanation, or action proposed by an automated tool.
|
|
193
|
+
|
|
194
|
+
The user should consult qualified professionals before making legal, tax, accounting, financial, compliance, sanctions,
|
|
195
|
+
or regulatory decisions.
|
|
196
|
+
|
|
197
|
+
## 14. Risk Disclosures
|
|
198
|
+
|
|
199
|
+
Public blockchain systems, smart contracts, bridges, privacy-preserving cryptographic software, wallets, and RPC
|
|
200
|
+
providers involve significant operational, technical, security, market, regulatory, and legal risks.
|
|
201
|
+
|
|
202
|
+
Transactions recorded on Ethereum mainnet may be irreversible.
|
|
203
|
+
|
|
204
|
+
Software bugs, user mistakes, compromised devices, malicious third parties, governance actions, protocol upgrades,
|
|
205
|
+
network congestion, RPC failure, Bridge failure, smart-contract failure, cryptographic implementation defects, or
|
|
206
|
+
changes in law may cause loss, delay, rejected transactions, unavailable services, or loss of access.
|
|
207
|
+
|
|
208
|
+
Digital assets may be volatile and may lose value.
|
|
209
|
+
|
|
210
|
+
The user assumes all risks permitted by applicable law.
|
|
211
|
+
|
|
212
|
+
## 15. No Warranties
|
|
213
|
+
|
|
214
|
+
The Service is provided "as is" and "as available" to the maximum extent permitted by applicable law.
|
|
215
|
+
|
|
216
|
+
No Provider Party warrants that the software or services will be uninterrupted, secure, error-free, accurate, complete,
|
|
217
|
+
compatible, available in any jurisdiction, accepted by any exchange, or suitable for any particular purpose.
|
|
218
|
+
|
|
219
|
+
No Provider Party warrants any token value, transaction result, privacy result, legal result, regulatory result,
|
|
220
|
+
compliance result, tax result, accounting result, third-party acceptance of the user's asset-history explanation, or
|
|
221
|
+
selective-disclosure result.
|
|
222
|
+
|
|
223
|
+
## 16. Limitation Of Liability
|
|
224
|
+
|
|
225
|
+
The Service is non-custodial open software and public-good infrastructure, and is not operated for Provider Party
|
|
226
|
+
Service revenue. The user accesses and uses the Service at the user's own risk to the maximum extent permitted by
|
|
227
|
+
applicable law.
|
|
228
|
+
|
|
229
|
+
To the maximum extent permitted by applicable law, Provider Parties are not liable for indirect, incidental, special,
|
|
230
|
+
consequential, exemplary, punitive, or similar damages.
|
|
231
|
+
|
|
232
|
+
To the maximum extent permitted by applicable law, Provider Parties are not liable for lost profits, loss of data, lost
|
|
233
|
+
secrets, failed transactions, wrong transactions, loss of access, loss of assets, loss of evidence, business
|
|
234
|
+
interruption, Third-Party Service failures, exchange actions, regulatory actions, tax consequences, user error, device
|
|
235
|
+
compromise, or unauthorized access.
|
|
236
|
+
|
|
237
|
+
To the maximum extent permitted by applicable law, Provider Parties are not liable for the user's access to, use of,
|
|
238
|
+
inability to use, or reliance on the Service.
|
|
239
|
+
|
|
240
|
+
Join Tolls are not Provider Party revenue. Non-refunded Join Toll amounts do not create a custodial, refund, credit,
|
|
241
|
+
account-balance, or revenue-sharing relationship between the user and Provider Parties.
|
|
242
|
+
|
|
243
|
+
Nothing in these Terms excludes or limits liability that cannot be excluded or limited under applicable law, including
|
|
244
|
+
liability for fraud, willful misconduct, gross negligence, death, or personal injury where such exclusion or limitation is
|
|
245
|
+
not permitted.
|
|
246
|
+
|
|
247
|
+
## 17. User Indemnity
|
|
248
|
+
|
|
249
|
+
To the maximum extent permitted by applicable law, the user must indemnify, defend, and hold harmless the Provider
|
|
250
|
+
Parties from claims, damages, losses, liabilities, penalties, costs, and expenses arising from the user's breach of the
|
|
251
|
+
Terms, unlawful use, misuse, violation of third-party rights, interaction with Third-Party Services, or use of the
|
|
252
|
+
Service on behalf of another person or organization.
|
|
253
|
+
|
|
254
|
+
## 18. Changes To Terms And Renewed Acceptance
|
|
255
|
+
|
|
256
|
+
Provider Parties may update these Terms.
|
|
257
|
+
|
|
258
|
+
If the current Terms differ from the Terms previously accepted by the user, the user must accept the current Terms before
|
|
259
|
+
continuing to use terms-gated Service operations.
|
|
260
|
+
|
|
261
|
+
Renewed acceptance may be collected only after the current Terms are displayed to the user.
|
|
262
|
+
|
|
263
|
+
The Service may store acceptance metadata needed to verify whether the user accepted the current Terms.
|
|
264
|
+
|
|
265
|
+
If no current acceptance record exists, or if the stored acceptance record is stale, the Service may reject terms-gated
|
|
266
|
+
operations until the current Terms are displayed and the user submits the required acceptance.
|
|
267
|
+
|
|
268
|
+
The user must not rely on automated output or an automated tool to accept changed Terms on the user's behalf.
|
|
269
|
+
|
|
270
|
+
## 19. Suspension, Discontinuation, And Software Changes
|
|
271
|
+
|
|
272
|
+
Provider Parties may modify, suspend, discontinue, or stop supporting software, documentation, official interfaces, or
|
|
273
|
+
related services.
|
|
274
|
+
|
|
275
|
+
Open-source smart contracts and public blockchain records may continue to exist independently of any supported
|
|
276
|
+
interface.
|
|
277
|
+
|
|
278
|
+
Provider Parties cannot reverse public Ethereum mainnet transactions or recover user secrets.
|
|
279
|
+
|
|
280
|
+
## 20. Governing Law, Venue, Dispute Resolution, And Notices
|
|
281
|
+
|
|
282
|
+
These Terms are governed by the laws of Singapore, excluding conflict-of-law rules.
|
|
283
|
+
|
|
284
|
+
Subject to non-waivable rights under applicable law, disputes arising from or relating to these Terms or the Service will
|
|
285
|
+
be resolved in the courts located in Singapore.
|
|
286
|
+
|
|
287
|
+
These Terms do not require arbitration and do not include a class-action waiver, collective-action waiver,
|
|
288
|
+
representative-action waiver, or jury-trial waiver.
|
|
289
|
+
|
|
290
|
+
Provider Parties may provide notices through official Service interfaces, official websites, release notes, email, or
|
|
291
|
+
other contact methods stated in these Terms.
|
|
292
|
+
|
|
293
|
+
These Terms do not limit any non-waivable consumer rights or mandatory local-law rights that apply in the user's
|
|
294
|
+
jurisdiction.
|
package/assets/tx-fees.json
CHANGED
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"command": "channel join",
|
|
63
|
-
"description": "Pay the channel
|
|
63
|
+
"description": "Pay the channel Join Toll and register a wallet identity.",
|
|
64
64
|
"transactions": [
|
|
65
65
|
{
|
|
66
66
|
"label": "approve",
|
|
@@ -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). channel join sends this approval only when the channel
|
|
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",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"command": "wallet deposit-channel",
|
|
85
|
-
"description": "Move bridged funds into the channel
|
|
85
|
+
"description": "Move bridged funds into the channel accounting vault.",
|
|
86
86
|
"transactions": [
|
|
87
87
|
{
|
|
88
88
|
"label": "depositToChannelVault",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"command": "wallet withdraw-channel",
|
|
101
|
-
"description": "Move channel
|
|
101
|
+
"description": "Move channel accounting vault funds back into the shared bridge vault.",
|
|
102
102
|
"transactions": [
|
|
103
103
|
{
|
|
104
104
|
"label": "withdrawFromChannelVault",
|
package/commands/account.mjs
CHANGED
|
@@ -10,15 +10,17 @@ import {
|
|
|
10
10
|
handleDepositBridge,
|
|
11
11
|
handleWithdrawBridge,
|
|
12
12
|
loadExplicitCommandRuntime,
|
|
13
|
+
requireCurrentTermsAcceptanceForCommand,
|
|
13
14
|
} from "../lib/runtime.mjs";
|
|
14
15
|
|
|
15
16
|
export const accountCommands = Object.freeze({
|
|
16
17
|
"account-get-l1-address": async (args) => {
|
|
17
18
|
assertAccountGetL1AddressArgs(args);
|
|
18
|
-
handleAccountGetL1Address({ args });
|
|
19
|
+
await handleAccountGetL1Address({ args });
|
|
19
20
|
},
|
|
20
21
|
"account-import": async (args) => {
|
|
21
22
|
assertAccountImportArgs(args);
|
|
23
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
22
24
|
handleAccountImport({ args });
|
|
23
25
|
},
|
|
24
26
|
"account-get-bridge-fund": async (args) => {
|
|
@@ -28,11 +30,13 @@ export const accountCommands = Object.freeze({
|
|
|
28
30
|
},
|
|
29
31
|
"account-deposit-bridge": async (args) => {
|
|
30
32
|
assertDepositBridgeArgs(args);
|
|
33
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
31
34
|
const { network, provider } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
32
35
|
await handleDepositBridge({ args, network, provider });
|
|
33
36
|
},
|
|
34
37
|
"account-withdraw-bridge": async (args) => {
|
|
35
38
|
assertWithdrawBridgeArgs(args);
|
|
39
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
36
40
|
const { network, provider } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
37
41
|
await handleWithdrawBridge({ args, network, provider });
|
|
38
42
|
},
|
package/commands/channel.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertCreateChannelArgs,
|
|
3
|
+
assertAbandonChannelOperationArgs,
|
|
3
4
|
assertExitChannelArgs,
|
|
4
5
|
assertGetChannelArgs,
|
|
5
6
|
assertJoinChannelArgs,
|
|
@@ -7,6 +8,7 @@ import {
|
|
|
7
8
|
assertRecoverWorkspaceArgs,
|
|
8
9
|
assertSetWorkspaceMirrorArgs,
|
|
9
10
|
handleChannelCreate,
|
|
11
|
+
handleAbandonChannelOperation,
|
|
10
12
|
handleExitChannel,
|
|
11
13
|
handleGetChannel,
|
|
12
14
|
handleJoinChannel,
|
|
@@ -14,16 +16,19 @@ import {
|
|
|
14
16
|
handleWorkspaceInit,
|
|
15
17
|
loadExplicitCommandRuntime,
|
|
16
18
|
loadWalletCommandRuntime,
|
|
19
|
+
requireCurrentTermsAcceptanceForCommand,
|
|
17
20
|
} from "../lib/runtime.mjs";
|
|
18
21
|
|
|
19
22
|
export const channelCommands = Object.freeze({
|
|
20
23
|
"channel-create": async (args) => {
|
|
21
24
|
assertCreateChannelArgs(args);
|
|
25
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
22
26
|
const { network, provider } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
23
27
|
await handleChannelCreate({ args, network, provider });
|
|
24
28
|
},
|
|
25
29
|
"channel-recover-workspace": async (args) => {
|
|
26
30
|
assertRecoverWorkspaceArgs(args);
|
|
31
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
27
32
|
const { network, provider, rpcUrl } = loadExplicitCommandRuntime(args, { staticNetwork: true, prepareArtifacts: true });
|
|
28
33
|
await assertProviderChainIdMatchesNetwork({ provider, network, rpcUrl });
|
|
29
34
|
await handleWorkspaceInit({ args, network, provider });
|
|
@@ -35,16 +40,25 @@ export const channelCommands = Object.freeze({
|
|
|
35
40
|
},
|
|
36
41
|
"channel-set-workspace-mirror": async (args) => {
|
|
37
42
|
assertSetWorkspaceMirrorArgs(args);
|
|
43
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
38
44
|
const { network, provider } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
39
45
|
await handleSetChannelWorkspaceMirror({ args, network, provider });
|
|
40
46
|
},
|
|
47
|
+
"channel-abandon-operation": async (args) => {
|
|
48
|
+
assertAbandonChannelOperationArgs(args);
|
|
49
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
50
|
+
const { network, provider } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
51
|
+
await handleAbandonChannelOperation({ args, network, provider });
|
|
52
|
+
},
|
|
41
53
|
"channel-join": async (args) => {
|
|
42
54
|
assertJoinChannelArgs(args);
|
|
55
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
43
56
|
const { network, provider, rpcUrl } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
44
57
|
await handleJoinChannel({ args, network, provider, rpcUrl });
|
|
45
58
|
},
|
|
46
59
|
"channel-exit": async (args) => {
|
|
47
60
|
assertExitChannelArgs(args);
|
|
61
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
48
62
|
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
49
63
|
await handleExitChannel({ args, provider });
|
|
50
64
|
},
|
package/commands/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertHelpCommandsArgs,
|
|
3
3
|
assertVersionArgs,
|
|
4
|
+
closeBrowserWalletBridgeSession,
|
|
4
5
|
cliOutput,
|
|
5
6
|
configureOutput,
|
|
6
7
|
parseArgs,
|
|
@@ -11,6 +12,7 @@ import { accountCommands } from "./account.mjs";
|
|
|
11
12
|
import { channelCommands } from "./channel.mjs";
|
|
12
13
|
import { investigatorCommands } from "./investigator.mjs";
|
|
13
14
|
import { notesCommands } from "./notes.mjs";
|
|
15
|
+
import { secretCommands } from "./secret.mjs";
|
|
14
16
|
import { systemCommands } from "./system.mjs";
|
|
15
17
|
import { walletCommands } from "./wallet.mjs";
|
|
16
18
|
|
|
@@ -18,6 +20,7 @@ const COMMANDS = Object.freeze({
|
|
|
18
20
|
...systemCommands,
|
|
19
21
|
...investigatorCommands,
|
|
20
22
|
...accountCommands,
|
|
23
|
+
...secretCommands,
|
|
21
24
|
...channelCommands,
|
|
22
25
|
...walletCommands,
|
|
23
26
|
...notesCommands,
|
|
@@ -54,5 +57,7 @@ export async function runPrivateStateCli(argv) {
|
|
|
54
57
|
} catch (error) {
|
|
55
58
|
cliOutput.error(error, args);
|
|
56
59
|
process.exitCode = 1;
|
|
60
|
+
} finally {
|
|
61
|
+
await closeBrowserWalletBridgeSession();
|
|
57
62
|
}
|
|
58
63
|
}
|
package/commands/notes.mjs
CHANGED
|
@@ -8,26 +8,31 @@ import {
|
|
|
8
8
|
handleTransferNotes,
|
|
9
9
|
handleWalletGetNotes,
|
|
10
10
|
loadWalletCommandRuntime,
|
|
11
|
+
requireCurrentTermsAcceptanceForCommand,
|
|
11
12
|
} from "../lib/runtime.mjs";
|
|
12
13
|
|
|
13
14
|
export const notesCommands = Object.freeze({
|
|
14
15
|
"wallet-mint-notes": async (args) => {
|
|
15
16
|
assertMintNotesArgs(args);
|
|
17
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
16
18
|
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
17
19
|
await handleMintNotes({ args, provider });
|
|
18
20
|
},
|
|
19
21
|
"wallet-redeem-notes": async (args) => {
|
|
20
22
|
assertRedeemNotesArgs(args);
|
|
23
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
21
24
|
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
22
25
|
await handleRedeemNotes({ args, provider });
|
|
23
26
|
},
|
|
24
27
|
"wallet-get-notes": async (args) => {
|
|
25
28
|
assertWalletGetNotesArgs(args);
|
|
29
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
26
30
|
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
27
31
|
await handleWalletGetNotes({ args, provider });
|
|
28
32
|
},
|
|
29
33
|
"wallet-transfer-notes": async (args) => {
|
|
30
34
|
assertTransferNotesArgs(args);
|
|
35
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
31
36
|
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
32
37
|
await handleTransferNotes({ args, provider });
|
|
33
38
|
},
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertCreatePrivateKeySourceArgs,
|
|
3
|
+
assertCreateWalletSecretSourceArgs,
|
|
4
|
+
handleCreatePrivateKeySource,
|
|
5
|
+
handleCreateWalletSecretSource,
|
|
6
|
+
requireCurrentTermsAcceptanceForCommand,
|
|
7
|
+
} from "../lib/runtime.mjs";
|
|
8
|
+
|
|
9
|
+
export const secretCommands = Object.freeze({
|
|
10
|
+
"secret-create-private-key-source": async (args) => {
|
|
11
|
+
assertCreatePrivateKeySourceArgs(args);
|
|
12
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
13
|
+
await handleCreatePrivateKeySource({ args });
|
|
14
|
+
},
|
|
15
|
+
"secret-create-wallet-secret-source": async (args) => {
|
|
16
|
+
assertCreateWalletSecretSourceArgs(args);
|
|
17
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
18
|
+
await handleCreateWalletSecretSource({ args });
|
|
19
|
+
},
|
|
20
|
+
});
|
package/commands/system.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
assertDoctorArgs,
|
|
3
3
|
assertGuideArgs,
|
|
4
4
|
assertObserverArgs,
|
|
5
|
+
assertProviderChainIdMatchesNetwork,
|
|
5
6
|
assertInstallZkEvmArgs,
|
|
6
7
|
assertSetRpcArgs,
|
|
7
8
|
assertTransactionFeesArgs,
|
|
@@ -16,6 +17,7 @@ import {
|
|
|
16
17
|
handleUninstall,
|
|
17
18
|
handleUpdate,
|
|
18
19
|
loadExplicitCommandRuntime,
|
|
20
|
+
requireCurrentTermsAcceptanceForCommand,
|
|
19
21
|
} from "../lib/runtime.mjs";
|
|
20
22
|
|
|
21
23
|
export const systemCommands = Object.freeze({
|
|
@@ -25,7 +27,8 @@ export const systemCommands = Object.freeze({
|
|
|
25
27
|
},
|
|
26
28
|
uninstall: async (args) => {
|
|
27
29
|
assertUninstallArgs(args);
|
|
28
|
-
await
|
|
30
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
31
|
+
await handleUninstall({ args });
|
|
29
32
|
},
|
|
30
33
|
"set-rpc": async (args) => {
|
|
31
34
|
assertSetRpcArgs(args);
|
|
@@ -45,7 +48,9 @@ export const systemCommands = Object.freeze({
|
|
|
45
48
|
},
|
|
46
49
|
"help-observer": async (args) => {
|
|
47
50
|
assertObserverArgs(args);
|
|
48
|
-
|
|
51
|
+
const { network, provider, rpcUrl } = loadExplicitCommandRuntime(args, { staticNetwork: true, prepareArtifacts: true });
|
|
52
|
+
await assertProviderChainIdMatchesNetwork({ provider, network, rpcUrl });
|
|
53
|
+
await handleObserver({ args, network, provider });
|
|
49
54
|
},
|
|
50
55
|
"help-transaction-fees": async (args) => {
|
|
51
56
|
assertTransactionFeesArgs(args);
|
package/commands/wallet.mjs
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
handleWalletImportKey,
|
|
21
21
|
loadExplicitCommandRuntime,
|
|
22
22
|
loadWalletCommandRuntime,
|
|
23
|
+
requireCurrentTermsAcceptanceForCommand,
|
|
23
24
|
} from "../lib/runtime.mjs";
|
|
24
25
|
|
|
25
26
|
export const walletCommands = Object.freeze({
|
|
@@ -29,30 +30,37 @@ export const walletCommands = Object.freeze({
|
|
|
29
30
|
},
|
|
30
31
|
"wallet-export-backup": async (args) => {
|
|
31
32
|
assertWalletExportBackupArgs(args);
|
|
33
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
32
34
|
handleWalletExportBackup({ args });
|
|
33
35
|
},
|
|
34
36
|
"wallet-export-viewing-key": async (args) => {
|
|
35
37
|
assertWalletExportKeyArgs(args, "wallet-export-viewing-key");
|
|
36
|
-
|
|
38
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
39
|
+
await handleWalletExportKey({ args, keyKind: "viewing" });
|
|
37
40
|
},
|
|
38
41
|
"wallet-export-spending-key": async (args) => {
|
|
39
42
|
assertWalletExportKeyArgs(args, "wallet-export-spending-key");
|
|
40
|
-
|
|
43
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
44
|
+
await handleWalletExportKey({ args, keyKind: "spending" });
|
|
41
45
|
},
|
|
42
46
|
"wallet-import-backup": async (args) => {
|
|
43
47
|
assertWalletImportBackupArgs(args);
|
|
48
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
44
49
|
handleWalletImportBackup({ args });
|
|
45
50
|
},
|
|
46
51
|
"wallet-import-viewing-key": async (args) => {
|
|
47
52
|
assertWalletImportKeyArgs(args, "wallet-import-viewing-key");
|
|
53
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
48
54
|
handleWalletImportKey({ args, keyKind: "viewing" });
|
|
49
55
|
},
|
|
50
56
|
"wallet-import-spending-key": async (args) => {
|
|
51
57
|
assertWalletImportKeyArgs(args, "wallet-import-spending-key");
|
|
58
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
52
59
|
handleWalletImportKey({ args, keyKind: "spending" });
|
|
53
60
|
},
|
|
54
61
|
"wallet-recover-workspace": async (args) => {
|
|
55
62
|
assertRecoverWalletArgs(args);
|
|
63
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
56
64
|
const { network, provider, rpcUrl } = loadExplicitCommandRuntime(args, { staticNetwork: true, prepareArtifacts: true });
|
|
57
65
|
await assertProviderChainIdMatchesNetwork({ provider, network, rpcUrl });
|
|
58
66
|
await handleRecoverWallet({ args, network, provider, rpcUrl });
|
|
@@ -69,11 +77,13 @@ export const walletCommands = Object.freeze({
|
|
|
69
77
|
},
|
|
70
78
|
"wallet-deposit-channel": async (args) => {
|
|
71
79
|
assertWalletChannelMoveArgs(args, "wallet-deposit-channel");
|
|
80
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
72
81
|
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
73
82
|
await handleGrothVaultMove({ args, provider, direction: "deposit" });
|
|
74
83
|
},
|
|
75
84
|
"wallet-withdraw-channel": async (args) => {
|
|
76
85
|
assertWalletChannelMoveArgs(args, "wallet-withdraw-channel");
|
|
86
|
+
await requireCurrentTermsAcceptanceForCommand(args);
|
|
77
87
|
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
78
88
|
await handleGrothVaultMove({ args, provider, direction: "withdraw" });
|
|
79
89
|
},
|
package/investigator/README.md
CHANGED
|
@@ -6,21 +6,23 @@ This directory contains a static browser tool for filtering a local raw evidence
|
|
|
6
6
|
private-state-cli wallet get-notes \
|
|
7
7
|
--network <NETWORK> \
|
|
8
8
|
--wallet <WALLET> \
|
|
9
|
-
--export-evidence ./wallet-evidence.zip
|
|
10
|
-
--acknowledge-full-note-plaintext-export
|
|
9
|
+
--export-evidence ./wallet-evidence.zip
|
|
11
10
|
```
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
the
|
|
12
|
+
Mainnet evidence export asks for interactive confirmation before writing plaintext note evidence;
|
|
13
|
+
Sepolia and anvil evidence export do not. User-Controlled AI Agents must not confirm the export or
|
|
14
|
+
receive the raw evidence ZIP. Open `index.html` in a modern browser, load the raw ZIP, choose the
|
|
15
|
+
disclosure request type, inspect the graph, and build a narrower user-consent disclosure ZIP. From
|
|
16
|
+
an installed CLI package, `private-state-cli investigator` prints the bundled HTML path and opens it
|
|
17
|
+
in the default browser.
|
|
16
18
|
|
|
17
19
|
The tool does not run a server and does not send files over the network. It reads the selected ZIP in
|
|
18
20
|
the browser. It can write a new ZIP with selected note records plus directly referenced transaction,
|
|
19
|
-
receipt, and event files, and it can export a Markdown
|
|
21
|
+
receipt, and event files, and it can export a Markdown plain-text linkage report.
|
|
20
22
|
|
|
21
|
-
The raw evidence bundle contains plaintext for all locally known notes
|
|
22
|
-
as an exchange or auditor package unless full wallet-history disclosure is
|
|
23
|
-
investigator output package for scoped disclosure.
|
|
23
|
+
The raw evidence bundle contains plaintext for all locally known notes and may include retained exited epochs for the
|
|
24
|
+
selected wallet. Do not submit the raw bundle as an exchange or auditor package unless full wallet-history disclosure is
|
|
25
|
+
intended. Use the investigator output package for scoped disclosure.
|
|
24
26
|
|
|
25
27
|
The investigator accepts current epoch-aware evidence bundles only. Supported note records live under
|
|
26
28
|
`wallets/<wallet>/epochs/<epoch-id>/notes/` inside the ZIP. If a bundle uses an older layout, rebuild the local wallet
|
|
@@ -34,7 +36,7 @@ workspace with `wallet recover-workspace` and export a new evidence ZIP with `wa
|
|
|
34
36
|
- graph edges for external note creation, external note spend, and locally recoverable note-to-note linkage
|
|
35
37
|
- node detail overlays showing commitment, nullifier, value, status, creation reference, spend reference, direction, and
|
|
36
38
|
available counterparty metadata
|
|
37
|
-
- a Markdown
|
|
39
|
+
- a Markdown plain-text report with a compact graph section and separate note detail sections
|
|
38
40
|
|
|
39
41
|
## Supported Filtering Inputs
|
|
40
42
|
|
|
@@ -43,7 +45,7 @@ workspace with `wallet recover-workspace` and export a new evidence ZIP with `wa
|
|
|
43
45
|
- creation or spend block range
|
|
44
46
|
- current note status
|
|
45
47
|
- relationship direction
|
|
46
|
-
- available counterparty
|
|
48
|
+
- available counterparty channel-local address metadata
|
|
47
49
|
- user-provided bridge deposit or withdraw transaction context
|
|
48
50
|
|
|
49
51
|
Counterparty filtering is only as complete as the relationship hints present in the raw evidence
|