Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/build-netbsd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NetBSD Build Guide

Updated for NetBSD [9.2](https://netbsd.org/releases/formal-9/NetBSD-9.2.html).
**Updated for NetBSD [10.0](https://netbsd.org/releases/formal-10/NetBSD-10.0.html)**

This guide describes how to build dashd, command-line utilities, and GUI on NetBSD.

Expand All @@ -14,7 +14,7 @@ Install the required dependencies the usual way you [install software on NetBSD]
The example commands below use `pkgin`.

```bash
pkgin install autoconf automake libtool pkg-config git gmake boost libevent zstd
pkgin install autoconf automake libtool pkg-config git gmake boost-headers libevent zstd

```

Expand Down Expand Up @@ -68,10 +68,10 @@ pkgin install db4

#### GUI Dependencies

Dash Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install `qt5`.
Dash Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, Qt 5 is required.

```bash
pkgin install qt5
pkgin install qt5-qtbase qt5-qttools
```

The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `qrencode`.
Expand Down
5 changes: 3 additions & 2 deletions doc/descriptors.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Output descriptors currently support:
- `sortedmulti(1,022f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4,025cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc)` describes a bare *1-of-2* multisig with keys sorted lexicographically in the resulting redeemScript.
- `pkh(xpub68Gmy5EdvgibQVfPdqkBBCHxA5htiqg55crXYuXoQRKfDBFA1WEjWgP6LHhwBZeNK1VTsfTFUHCdrfp1bgwQ9xv5ski8PX9rL2dZXvgGDnw/1/2)` describes a P2PKH output with child key *1/2* of the specified xpub.
- `pkh([d34db33f/44'/0'/0']xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/1/*)` describes a set of P2PKH outputs, but additionally specifies that the specified xpub is a child of a master with fingerprint `d34db33f`, and derived using path `44'/0'/0'`.
- `sh(sortedmulti(2,[6f53d49c/44h/1h/0h]tpubDDjsCRDQ9YzyaAq9rspCfq8RZFrWoBpYnLxK6sS2hS2yukqSczgcYiur8Scx4Hd5AZatxTuzMtJQJhchufv1FRFanLqUP7JHwusSSpfcEp2/0/*,[e6807791/44h/1h/0h]tpubDDAfvogaaAxaFJ6c15ht7Tq6ZmiqFYfrSmZsHu7tHXBgnjMZSHAeHSwhvjARNA6Qybon4ksPksjRbPDVp7yXA1KjTjSd5x18KHqbppnXP1s/0/*,[367c9cfa/44h/1h/0h]tpubDDtPnSgWYk8dDnaDwnof4ehcnjuL5VoUt1eW2MoAed1grPHuXPDnkX1fWMvXfcz3NqFxPbhqNZ3QBdYjLz2hABeM9Z2oqMR1Gt2HHYDoCgh/0/*))#6adrlqpw` describes a *2-of-3* multisig. For brevity, the internal "change" descriptor accompanying the above external "receiving" descriptor is not included here, but it typically differs only in the xpub derivation steps, ending in `/1/*` for change addresses.

## Reference

Expand Down Expand Up @@ -138,9 +139,9 @@ The basic steps are:
the participant's signer wallet. Avoid reusing this wallet for any purpose other than signing transactions from the
corresponding multisig we are about to create. Hint: extract the wallet's xpubs using `listdescriptors` and pick the one from the
`pkh` descriptor since it's least likely to be accidentally reused (legacy addresses)
2. Create a watch-only descriptor wallet (blank, private keys disabled). Now the multisig is created by importing the two descriptors:
2. Create a watch-only descriptor wallet (blank, private keys disabled). Now the multisig is created by importing the external and internal descriptors:
`wsh(sortedmulti(<M>,XPUB1/0/*,XPUB2/0/*,…,XPUBN/0/*))` and `wsh(sortedmulti(<M>,XPUB1/1/*,XPUB2/1/*,…,XPUBN/1/*))`
(one descriptor w/ `0` for receiving addresses and another w/ `1` for change). Every participant does this
(one descriptor w/ `0` for receiving addresses and another w/ `1` for change). Every participant does this. All key origin information (master key fingerprint and all derivation steps) should be included with xpubs for proper support of hardware devices / external signers
Comment on lines +142 to +144

@thepastaclaw thepastaclaw Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⏸️ Needs a tracking issue (not yet deferred) at 4166c982; see the replies below.

🟡 Suggestion: Multisig instructions still use unsupported wsh() descriptors

The updated multisig procedure still instructs users to import wsh(sortedmulti(...)) descriptors. Dash's descriptor parser has no wsh() branch and rejects it as an invalid descriptor function, whereas the new example and adapted functional test correctly use sh() because Dash has no SegWit support. Following this procedure therefore fails when the descriptors are passed to getdescriptorinfo; both wrappers in step 2 should be changed to sh().

Suggested change
2. Create a watch-only descriptor wallet (blank, private keys disabled). Now the multisig is created by importing the external and internal descriptors:
`wsh(sortedmulti(<M>,XPUB1/0/*,XPUB2/0/*,…,XPUBN/0/*))` and `wsh(sortedmulti(<M>,XPUB1/1/*,XPUB2/1/*,…,XPUBN/1/*))`
(one descriptor w/ `0` for receiving addresses and another w/ `1` for change). Every participant does this
(one descriptor w/ `0` for receiving addresses and another w/ `1` for change). Every participant does this. All key origin information (master key fingerprint and all derivation steps) should be included with xpubs for proper support of hardware devices / external signers
`sh(sortedmulti(<M>,XPUB1/0/*,XPUB2/0/*,…,XPUBN/0/*))` and `sh(sortedmulti(<M>,XPUB1/1/*,XPUB2/1/*,…,XPUBN/1/*))`

source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.1-sol (phase2-reviewer: general, backport-reviewer, dash-core-commit-history); fresh:general

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wsh(sortedmulti(...)) line in step 2 was already in Dash before this backport: the bitcoin#29154 diff leaves it as unchanged context and only edits the lines around it, exactly as upstream does. The bot is right that Dash can't parse wsh(), but this commit didn't cause that, and its own new example and test already use sh(). Switching step 2 to sh() should go in a separate Dash-only doc fix, not in this backport.


🤖 backportsys, on behalf of the Dash backport pipeline.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified that the wsh(sortedmulti(...)) instructions predate this backport and are unchanged by it; the current line is still technically invalid for Dash, but I agree that correcting it belongs in a separate Dash documentation fix. Before I mark this deferred, please link the follow-up issue or PR, or say so and I’ll file it in dashpay/dash.

Not deferred yet: a deferral needs a tracking issue for the follow-up; until then the finding stands.

3. A receiving address is generated for the multisig. As a check to ensure step 2 was done correctly, every participant
should verify they get the same addresses
4. Funds are sent to the resulting address
Expand Down
2 changes: 1 addition & 1 deletion doc/tor.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ In a typical situation, where you're only reachable via Tor, this should suffice
listen on all devices and another node could establish a clearnet connection, when knowing
your address. To mitigate this, additionally bind the address of your Tor proxy:

./dashd ... -bind=127.0.0.1
./dashd ... -bind=127.0.0.1:9996=onion

If you don't care too much about hiding your node, and want to be reachable on IPv4
as well, use `discover` instead:
Expand Down
25 changes: 10 additions & 15 deletions test/functional/wallet_multisig_descriptor_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
This is meant to be documentation as much as functional tests, so it is kept as simple and readable as possible.
"""

from test_framework.address import base58_to_byte
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_approx,
Expand All @@ -30,10 +29,12 @@ def skip_test_if_missing_module(self):
self.skip_if_no_sqlite()

@staticmethod
def _get_xpub(wallet):
def _get_xpub(wallet, internal):
"""Extract the wallet's xpubs using `listdescriptors` and pick the one from the `pkh` descriptor since it's least likely to be accidentally reused (legacy addresses)."""
descriptor = next(filter(lambda d: d["desc"].startswith("pkh"), wallet.listdescriptors()["descriptors"]))
return descriptor["desc"].split("]")[-1].split("/")[0]
pkh_descriptor = next(filter(lambda d: d["desc"].startswith("pkh(") and d["internal"] == internal, wallet.listdescriptors()["descriptors"]))
# Keep all key origin information (master key fingerprint and all derivation steps) for proper support of hardware devices
# See section 'Key origin identification' in 'doc/descriptors.md' for more details...
return pkh_descriptor["desc"].split("pkh(")[1].split(")")[0]

@staticmethod
def _check_psbt(psbt, to, value, multisig):
Expand All @@ -47,19 +48,13 @@ def _check_psbt(psbt, to, value, multisig):
amount += vout["value"]
assert_approx(amount, float(value), vspan=0.001)

def participants_create_multisigs(self, xpubs):
def participants_create_multisigs(self, external_xpubs, internal_xpubs):
"""The multisig is created by importing the following descriptors. The resulting wallet is watch-only and every participant can do this."""
# some simple validation
assert_equal(len(xpubs), self.N)
# a sanity-check/assertion, this will throw if the base58 checksum of any of the provided xpubs are invalid
for xpub in xpubs:
base58_to_byte(xpub)

for i, node in enumerate(self.nodes):
node.createwallet(wallet_name=f"{self.name}_{i}", blank=True, descriptors=True, disable_private_keys=True)
multisig = node.get_wallet_rpc(f"{self.name}_{i}")
external = multisig.getdescriptorinfo(f"sh(sortedmulti({self.M},{f'/0/*,'.join(xpubs)}/0/*))")
internal = multisig.getdescriptorinfo(f"sh(sortedmulti({self.M},{f'/1/*,'.join(xpubs)}/1/*))")
external = multisig.getdescriptorinfo(f"sh(sortedmulti({self.M},{f','.join(external_xpubs)}))")
internal = multisig.getdescriptorinfo(f"sh(sortedmulti({self.M},{f','.join(internal_xpubs)}))")
result = multisig.importdescriptors([
{ # receiving addresses (internal: False)
"desc": external["descriptor"],
Expand Down Expand Up @@ -93,10 +88,10 @@ def run_test(self):
}

self.log.info("Generate and exchange xpubs...")
xpubs = [self._get_xpub(signer) for signer in participants["signers"]]
external_xpubs, internal_xpubs = [[self._get_xpub(signer, internal) for signer in participants["signers"]] for internal in [False, True]]

self.log.info("Every participant imports the following descriptors to create the watch-only multisig...")
participants["multisigs"] = list(self.participants_create_multisigs(xpubs))
participants["multisigs"] = list(self.participants_create_multisigs(external_xpubs, internal_xpubs))

self.log.info("Check that every participant's multisig generates the same addresses...")
for _ in range(10): # we check that the first 10 generated addresses are the same for all participant's multisigs
Expand Down
Loading