You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6eba965
Browse filesBrowse the repository at this point in the historyBrowse files
|`CardanoHeadlessWallet`| CIP-30 strict headless wallet (raw hex/CBOR returns) | You need raw CIP-30 output without conversion |
46
-
|`MeshCardanoBrowserWallet`| Full-featured browser wallet wrapper with convenience methods | dApp frontend integration with browser wallets (Eternl, Nami, etc.) |
47
-
|`CardanoBrowserWallet`| CIP-30 strict browser wallet wrapper (raw hex/CBOR returns) | You need raw CIP-30 passthrough from browser wallets |
48
-
|`CardanoInMemoryBip32`| BIP32 key derivation from mnemonic (keys stored in memory) | Deriving payment/stake/DRep keys from a mnemonic |
49
-
|`BaseSigner`| Ed25519 signer from raw private keys | Signing with raw private keys (normal or extended) |
50
-
|`CardanoAddress`| Cardano address construction and utilities | Building addresses from credentials |
51
-
|`ICardanoWallet`| Interface definition for Cardano wallets | Type-checking and implementing custom wallets |
52
-
|`createCip30Wallet`| Wraps an `ICardanoWallet` as a simulated CIP-30 initial API (`window.cardano.<name>`-shaped), with `enable()` extension negotiation | dApp integration tests / server-side agents that need a real `window.cardano`-shaped API, no browser |
53
-
|`createCip30Api`| Wraps an `ICardanoWallet` as a spec-exact `ICip30Api` directly, without extension negotiation | Advanced: you already have your own `enable()` gating and just need the spec-exact endpoints |
54
-
|`ICip30Api` / `ICip30InitialApi`| Interface definitions for the CIP-30 API surface | Type-checking and implementing custom CIP-30 adapters |
55
-
|`Cip30APIError`, `Cip30PaginateError`, `Cip30TxSignError`, `Cip30DataSignError`, `Cip30TxSendError`| CIP-30 error classes (spec-exact wire shapes: `{code, info}` or `{maxSize}`) | Catching and pattern-matching on typed CIP-30 errors instead of plain `Error`|
|`CardanoHeadlessWallet`| CIP-30 strict headless wallet (raw hex/CBOR returns) | You need raw CIP-30 output without conversion|
48
+
|`MeshCardanoBrowserWallet`| Full-featured browser wallet wrapper with convenience methods | dApp frontend integration with browser wallets (Eternl, Nami, etc.)|
49
+
|`CardanoBrowserWallet`| CIP-30 strict browser wallet wrapper (raw hex/CBOR returns) | You need raw CIP-30 passthrough from browser wallets|
50
+
|`CardanoInMemoryBip32`| BIP32 key derivation from mnemonic (keys stored in memory) | Deriving payment/stake/DRep keys from a mnemonic|
51
+
|`BaseSigner`| Ed25519 signer from raw private keys | Signing with raw private keys (normal or extended)|
52
+
|`CardanoAddress`| Cardano address construction and utilities | Building addresses from credentials|
53
+
|`ICardanoWallet`| Interface definition for Cardano wallets | Type-checking and implementing custom wallets|
54
+
|`createCip30Wallet`| Wraps an `ICardanoWallet` as a simulated CIP-30 initial API (`window.cardano.<name>`-shaped), with `enable()` extension negotiation| dApp integration tests / server-side agents that need a real `window.cardano`-shaped API, no browser |
55
+
|`createCip30Api`| Wraps an `ICardanoWallet` as a spec-exact `ICip30Api` directly, without extension negotiation | Advanced: you already have your own `enable()` gating and just need the spec-exact endpoints|
56
+
|`ICip30Api` / `ICip30InitialApi`| Interface definitions for the CIP-30 API surface | Type-checking and implementing custom CIP-30 adapters|
57
+
|`Cip30APIError`, `Cip30PaginateError`, `Cip30TxSignError`, `Cip30DataSignError`, `Cip30TxSendError`| CIP-30 error classes (spec-exact wire shapes: `{code, info}` or `{maxSize}`) | Catching and pattern-matching on typed CIP-30 errors instead of plain `Error`|
56
58
57
59
---
58
60
@@ -61,7 +63,7 @@ This package uses a two-tier class hierarchy for both headless and browser walle
`BitcoinHeadlessWallet` is the Bitcoin counterpart of the Cardano headless wallet: a server-side / Node.js wallet driven by a pluggable `IBitcoinProvider` data provider — the same fetcher/submitter pattern used on the Cardano side.
247
+
248
+
### Create from Mnemonic with the Maestro provider
`MaestroProvider` implements `IBitcoinProvider` against the [Maestro Bitcoin API](https://docs.gomaestro.org/bitcoin)'s Esplora-compatible endpoints. Any other `IBitcoinProvider` implementation can be swapped in — the wallet code doesn't change.
266
+
267
+
### Query UTXOs
268
+
269
+
```typescript
270
+
// All UTXOs across the payment (P2WPKH) and ordinals (P2TR) addresses,
271
+
// each annotated with the address and purpose it belongs to.
272
+
const utxos =awaitwallet.fetchUTXOs();
273
+
274
+
// Or query the provider directly for any address.
`signTransfer` selects inputs automatically, but the algorithm is also exported for standalone use — largest-first selection with BIP-141 vbyte-accurate fee estimation and automatic sub-dust change handling:
| Sign tx |`signTx()` → witness set |`signTxReturnFullTx()` → full signed tx |
309
385
310
386
The same pattern applies to `CardanoBrowserWallet` vs `MeshCardanoBrowserWallet`.
311
387
@@ -317,9 +393,9 @@ This package (`@meshsdk/wallet` v2) has breaking changes from the previous `Mesh
317
393
318
394
**Do not attempt to upgrade without reading the migration guides.** Key breaking changes include renamed classes, swapped method parameters, changed return types, and removed methods. Many changes compile without errors but fail silently at runtime.
319
395
320
-
| Migrating from | Migrating to | Guide |
321
-
|----------------|-------------|-------|
322
-
|`MeshWallet` (from `@meshsdk/wallet` or `@meshsdk/core`) |`MeshCardanoHeadlessWallet`|[`mesh-wallet-migration.md`](./mesh-wallet-migration.md)|
323
-
|`BrowserWallet` (from `@meshsdk/wallet` or `@meshsdk/core`) |`MeshCardanoBrowserWallet`|[`browser-wallet-migration.md`](./browser-wallet-migration.md)|
|`MeshWallet` (from `@meshsdk/wallet` or `@meshsdk/core`) |`MeshCardanoHeadlessWallet`|[`mesh-wallet-migration.md`](./mesh-wallet-migration.md)|
399
+
|`BrowserWallet` (from `@meshsdk/wallet` or `@meshsdk/core`) |`MeshCardanoBrowserWallet`|[`browser-wallet-migration.md`](./browser-wallet-migration.md)|
324
400
325
401
The migration guides are written for both human developers and LLM agents — they contain deterministic SEARCH/REPLACE patterns that can be applied file-by-file.
# Milestone Evidence — Standard Headless Wallet on Bitcoin
2
+
3
+
This document maps the milestone acceptance criteria to the code in this repository.
4
+
5
+
**Milestone output A:** Develop and deploy a standard headless wallet on Bitcoin.
6
+
7
+
The headless wallet is `BitcoinHeadlessWallet` ([`src/bitcoin/wallet/mesh/bitcoin-headless-wallet.ts`](./src/bitcoin/wallet/mesh/bitcoin-headless-wallet.ts)), a server-side / Node.js wallet implementing the [`IBitcoinWallet`](./src/bitcoin/interfaces/bitcoin-wallet.ts) interface, with BIP-39/BIP-32 key management, BIP-84 (P2WPKH) and BIP-86 (P2TR) address derivation, and a pluggable [`IBitcoinProvider`](./src/bitcoin/interfaces/bitcoin-provider.ts) data-provider interface mirroring the Mesh Cardano fetcher/submitter pattern.
8
+
9
+
## A1 — UTXO querying based on Maestro as the data provider
`MaestroProvider` covers address info, address UTXOs, per-transaction unspent outputs, paginated transaction history, transaction status, fee estimates (sat/vB with closest-target selection and a testnet fallback), and raw-transaction broadcast — all against Maestro's Esplora-compatible Bitcoin API using the platform `fetch` (no HTTP client dependency).
19
+
20
+
## A2 — Coin selection algorithm on queried Bitcoin UTXOs
Largest-first selection with BIP-141/BIP-144 vbyte-accurate fee estimation (11 vB overhead, 68 vB per P2WPKH input, 31 vB per output). Change below the 546-sat P2WPKH dust threshold is dropped and absorbed as miner fee; insufficient funds throw a descriptive error.
`signTransfer` fetches UTXOs from the provider, fetches a fee estimate (falling back to 2 sat/vB), runs coin selection, builds a BIP-125 RBF-enabled PSBT, signs, finalizes, and broadcasts through the provider, returning the txid.
38
+
39
+
## Usage
40
+
41
+
See the [Bitcoin Headless Wallet](./README.md#bitcoin-headless-wallet) section of the README for end-to-end examples.
0 commit comments