@ducat-unit/wallet-snap 0.3.0 → 0.3.2
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/README.md +64 -18
- package/dist/bundle.js +1 -1
- package/images/icon.svg +0 -3
- package/package.json +11 -4
- package/snap.manifest.json +5 -4
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@ confirmation prompts.
|
|
|
10
10
|
|
|
11
11
|
The production artifact supports exactly `mainnet` and `mutinynet`. The
|
|
12
12
|
role-neutral local development artifact adds `regtest`. The Snap has no
|
|
13
|
-
separate `alpha-mainnet` wallet network
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
separate `alpha-mainnet` wallet network. Its Mainnet and Mutinynet profiles use
|
|
14
|
+
the same production Mutinynet validator URL while retaining their existing Bitcoin address,
|
|
15
|
+
transaction, genesis, and wallet-derivation rules.
|
|
16
16
|
|
|
17
17
|
## What are snaps?
|
|
18
18
|
|
|
@@ -43,6 +43,12 @@ MetaMask from the same Secret Recovery Phrase recovers the same managed accounts
|
|
|
43
43
|
for this scheme. An imported key selected in Snap Home is an explicit override
|
|
44
44
|
and is not derived from this scheme.
|
|
45
45
|
|
|
46
|
+
The beta integration preserves all published `0.3.1` managed paths, including
|
|
47
|
+
the vault's `/2/0` suffix. It does not switch existing users to the older beta
|
|
48
|
+
`/0/1` vault key or migrate their vaults. Release verification checks the built
|
|
49
|
+
Snap against the `0.3.1` account fixtures, including fresh recovery, on Mainnet,
|
|
50
|
+
Mutinynet, and Regtest.
|
|
51
|
+
|
|
46
52
|
The Snap owns one explicit deployment selection. New production installations default to
|
|
47
53
|
`mutinynet`. `ducat_getNetwork()` returns that selection; `ducat_switchNetwork()`
|
|
48
54
|
changes it only after a MetaMask-owned confirmation showing the requesting origin,
|
|
@@ -62,14 +68,15 @@ The production artifact allows exactly these Ducat app origins:
|
|
|
62
68
|
|
|
63
69
|
```
|
|
64
70
|
https://app.ducatprotocol.com
|
|
65
|
-
https://dev.
|
|
66
|
-
https://
|
|
71
|
+
https://dev.ducatprotocol.com
|
|
72
|
+
https://test.ducatprotocol.com
|
|
67
73
|
```
|
|
68
74
|
|
|
69
75
|
`localhost` and preview deployments are intentionally absent from the published
|
|
70
76
|
manifest. The development artifact replaces this list with exactly
|
|
71
|
-
`http://localhost:3000`, `http://localhost:8075`, `http://frontend:3000`,
|
|
72
|
-
`http://ducat-admin:8075`; it does not
|
|
77
|
+
`http://localhost:3000`, `http://localhost:8075`, `http://frontend:3000`,
|
|
78
|
+
`http://ducat-admin:8075`, and `https://dev.ducatprotocol.com`; it does not
|
|
79
|
+
inherit other production origins. It contains
|
|
73
80
|
exactly `regtest`, `mainnet`, and `mutinynet`, defaults to `mutinynet`, and
|
|
74
81
|
disables debug and unprompted signing.
|
|
75
82
|
The test-only unprompted method refuses every deployment mapped to Bitcoin
|
|
@@ -81,29 +88,40 @@ while no server is running, and serves those frozen bytes only at
|
|
|
81
88
|
`local:http://localhost:8086`. Frontend and Admin are caller workflows of this
|
|
82
89
|
one local Snap; neither is an artifact-policy class. Production packaging stays
|
|
83
90
|
on the isolated production policy and contains no localhost or removed wallet
|
|
84
|
-
network authority.
|
|
85
|
-
|
|
91
|
+
network authority. Both production and development artifacts use the same
|
|
92
|
+
shared validator URL for Mainnet and Mutinynet; Regtest stays local.
|
|
86
93
|
|
|
87
94
|
From `ducat-infra`, use `make snap-down`, `make snap-install`, and
|
|
88
|
-
`make snap-check` before `make snap-serve`. Starting
|
|
89
|
-
|
|
95
|
+
`make snap-check` before `make snap-serve`. Starting Admin does not build, start,
|
|
96
|
+
stop, or log the shared Snap. Snap install/update, key
|
|
90
97
|
import, funding, prompting, signing, and broadcast each remain separate
|
|
91
|
-
operator approvals. The
|
|
92
|
-
|
|
93
|
-
[`../../dev/runbooks/DUCAT_ADMIN_ALPHA_MAINNET.md`](../../dev/runbooks/DUCAT_ADMIN_ALPHA_MAINNET.md).
|
|
98
|
+
operator approvals. The bundled Mainnet profile requires the production
|
|
99
|
+
contract identity; an Alpha-configured validator is not compatible with it.
|
|
94
100
|
|
|
95
101
|
## Network Profiles and Endpoint Overrides
|
|
96
102
|
|
|
97
103
|
The Snap ships bundled network profiles in [`src/network-profiles.json`](src/network-profiles.json).
|
|
98
104
|
Each profile carries a canonical Snap network, the Bitcoin network used for
|
|
99
105
|
address, transaction, transport, and genesis mechanics, and the exact
|
|
100
|
-
`chain_network` value expected from its validator
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
`chain_network` value expected from its validator:
|
|
107
|
+
|
|
108
|
+
| Snap network | Validator URL | Required `chain_network` |
|
|
109
|
+
| --- | --- | --- |
|
|
110
|
+
| Mainnet | `https://validator-mainnet.prod.ducatprotocol.com` | `main` |
|
|
111
|
+
| Mutinynet | `https://validator-mutinynet.prod.ducatprotocol.com` | `mutiny` |
|
|
112
|
+
|
|
113
|
+
`main` is Ducat Core's production chain identity; `mainnet` remains the Snap's
|
|
114
|
+
wallet network name. The endpoint update does not change any `0.3.1` account
|
|
115
|
+
derivation paths. A failed production request does not fall back to a dev or
|
|
116
|
+
alpha validator.
|
|
117
|
+
|
|
118
|
+
Each validator must report its own network identity. Mainnet rejects Mutinynet
|
|
119
|
+
data, and neither profile falls back to the other network when unavailable.
|
|
104
120
|
|
|
105
121
|
Users can set validator and Esplora endpoint overrides from Snap Home. Overrides are
|
|
106
122
|
stored in Snap state and apply to complete wallet inventory and signing verification.
|
|
123
|
+
Existing explicit overrides remain selected; clear them in Settings to use
|
|
124
|
+
the bundled production defaults.
|
|
107
125
|
Dapps pass only
|
|
108
126
|
the target network name; they do not pass arbitrary endpoint URLs into signing or
|
|
109
127
|
inventory RPC calls. Remote overrides require HTTPS and are verified against the
|
|
@@ -117,6 +135,13 @@ Home screen cannot modify a different network.
|
|
|
117
135
|
|
|
118
136
|
## Development
|
|
119
137
|
|
|
138
|
+
For the local Flask connector, run `npm run preview:flask` and open
|
|
139
|
+
`http://localhost:3000` in the browser with MetaMask Flask installed. The
|
|
140
|
+
connector installs or updates `local:http://localhost:8086`. After source
|
|
141
|
+
changes, stop the preview server and run the command again, then reconnect
|
|
142
|
+
to load the rebuilt Snap. The server holds a verified snapshot of the bundle
|
|
143
|
+
and manifest, so it never serves mismatched files during a rebuild.
|
|
144
|
+
|
|
120
145
|
```bash
|
|
121
146
|
npm ci
|
|
122
147
|
npm run build # mm-snap build -> dist/bundle.js
|
|
@@ -142,6 +167,27 @@ npm run verify:harness # MetaMask simulation harness (accounts, signing, BitVM
|
|
|
142
167
|
Point the frontend at the local build with `NEXT_PUBLIC_DUCAT_SNAP_ID="local:http://localhost:8080"`,
|
|
143
168
|
or at the published package with `NEXT_PUBLIC_DUCAT_SNAP_ID="npm:@ducat-unit/wallet-snap"`.
|
|
144
169
|
|
|
170
|
+
## Home and confirmation screens
|
|
171
|
+
|
|
172
|
+
Snap Home displays BTC, UNIT, and the permitted MetaMask ETH account, with
|
|
173
|
+
Bitcoin, UNIT, ETH, wUNIT, and USDC balances. The Ethereum provider permission
|
|
174
|
+
is used for account discovery only; opening Home can request missing account
|
|
175
|
+
access, while navigation reads existing access without prompting again.
|
|
176
|
+
Ethereum balances use Ethereum mainnet or Sepolia according to the selected
|
|
177
|
+
Snap network. wUNIT is configured for Sepolia; its mainnet address remains
|
|
178
|
+
unset until deployment. Price quotes and EVM balances are display-only and
|
|
179
|
+
are not used to authorize Bitcoin signing.
|
|
180
|
+
|
|
181
|
+
Settings contains the network selector, Bitcoin key override, and endpoint
|
|
182
|
+
editors. Copy fields and editing controls use native Snap components.
|
|
183
|
+
Vault confirmations show the action amount, destination, and verified
|
|
184
|
+
before/after values. Transaction sections start collapsed; full addresses
|
|
185
|
+
remain in Addresses & signing details. Raw UNIT inventory and app metadata
|
|
186
|
+
sections are omitted from confirmations. Input ownership, previous-output,
|
|
187
|
+
network, fee, and signing checks still run independently of these displays.
|
|
188
|
+
Vault comparison metadata remains internal to the Snap; the public wallet
|
|
189
|
+
inventory RPC retains its existing response shape for compatible apps.
|
|
190
|
+
|
|
145
191
|
## Security
|
|
146
192
|
|
|
147
193
|
Keys, child keys, WIFs, and raw entropy never leave the snap. The manifest grants entropy access
|