Skip to content

feat: decodeAddressPsbtData and vault-aware example dApp - #259

Open
victorkirov wants to merge 8 commits into
developfrom
feat/native-multisig
Open

victorkirov wants to merge 8 commits into
developfrom
feat/native-multisig

Conversation

@victorkirov

@victorkirov victorkirov commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Package pre-release info

Built at (UTC): 2026-09-25T13:06:19.099Z

npm install sats-connect@4.3.0-a55c116 -E
bun install sats-connect@4.3.0-a55c116 -E

Summary

Consumes @sats-connect/core@0.18.0 (secretkeylabs/sats-connect-core#127) and adds:

  • decodeAddressPsbtData(address) — hex-decodes the new scriptPubKey / unlockDefinition Address metadata into an object that spreads straight into @scure/btc-signer's tx.addInput (redeemScript, witnessScript, tapInternalKey, or tapLeafScript with a decoded control block), with typed errors for missing or malformed data.
  • Jest (ESM) setup and tests for every unlock variant.

Example dApp:

  • shows address type, wallet type, script pubkey and the unlock definition per address;
  • "Build & sign PSBT" for all five address variants (p2wpkh, p2sh-p2wpkh, p2tr key path, vault p2wsh, vault tapscript) from mempool.space UTXOs and fee rates, with selectable broadcast and no auto-broadcast;
  • derives the network from wallet_getNetwork (requests the read-network permission; fails closed instead of assuming mainnet);
  • copy describing real-time vault co-signing.

Pins @sats-connect/core to the PR prerelease 0.18.0-6d6c9b4; bump to the stable release before merging.

Update 2026-09-10

  • Example: vault sign-in panel (signMessage / signMultipleMessages), Starknet typed-data case with an is_valid_signature check, wallet_connect panel requests Spark and Starknet purposes.

- decodeAddressPsbtData() turns the new Address scriptPubKey / unlockDefinition
  metadata (@sats-connect/core 0.18.0) into a scure addInput-ready object
- jest ESM setup and tests for every unlock variant
- example: shows the metadata, builds and signs PSBTs for all five address
  variants, derives the network from the wallet (read-network permission),
  describes real-time vault co-signing
@netlify

netlify Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for sats-connect ready!

Name Link
🔨 Latest commit 28ef075
🔍 Latest deploy log https://app.netlify.com/projects/sats-connect/deploys/6ab6717deb94900008ac2d4b
😎 Deploy Preview https://deploy-preview-259--sats-connect.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

- signMessage / signMultipleMessages panel for the connected vault (BIP-322)
- Starknet typed-data signing case with an is_valid_signature check
- wallet_connect panel requests the Spark and Starknet purposes
@victorkirov victorkirov self-assigned this Sep 17, 2026
# Conflicts:
#	example/src/components/wallet/WalletConnect.tsx
#	package-lock.json
#	package.json
#	src/index.ts
The example reads the connected account through stx_getAccounts and builds non-sequential
multisig transactions (numSignatures, publicKeys, useNonSequentialMultiSig) for a vault entry;
single-sig stays on publicKey. The batch result shows transactions and txids, and a stopped
batch shows the per-transaction statuses from the error data. Pins @sats-connect/core
0.18.2-263ae91.
Adds a Bitcoin batch card that builds one PSBT per UTXO, each spending
that UTXO back to the address that owns it, and sends them through
signMultipleTransactions. Distinct UTXOs mean no conflicting inputs and
nothing leaves the wallet but the fee; the batch payload carries no
broadcast flag, so the wallet signs and broadcasts nothing. Stacks
batches were already covered by SignTransactions.

Both Bitcoin PSBT cards previously required scriptPubKey and
unlockDefinition from the wallet and silently disabled themselves
against older wallets that omit them. For a single-sig address both are
now derived locally from the address and its public key. A vault
address is not derivable and still needs a wallet that supplies them.
The builders default to mainnet, so a testnet vault's transactions carried a
mainnet signer version byte and the wallet rejected them as not bound to the
vault. Also fix the single-PSBT source select comparing an Address object to
its string.
@victorkirov victorkirov added the multisig Native multisig vaults label Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multisig Native multisig vaults

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant