Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
251```252Note how the first key is an xprv private key with a specific derivation path,253while the other two are public keys.256### Specifying receiving and change descriptors in one descriptor258Since receiving and change addresses are frequently derived from the same259extended key(s) but with a single derivation index changed, it is convenient260to be able to specify a descriptor that can derive at the two different261indexes. Thus a single tuple of indexes is allowed in each derivation path262following the extended key. When this descriptor is parsed, multiple descriptors263will be produced, the first one will use the first index in the tuple for all264key expressions, the second will use the second index, the third will use the265third index, and so on..267For example, a descriptor of the form:269multi(2,xpub.../<0;1;2>/0/*,xpub.../<2;3;4>/*)271will expand to the 3 descriptors273multi(2,xpub.../0/0/*,xpub.../2/*)274multi(2,xpub.../1/0/*,xpub.../3/*)275multi(2,xpub.../2/0/*,xpub.../4/*)277When this tuple contains only two elements, wallet implementations can use the278first descriptor for receiving addresses and the second descriptor for change addresses.280### Compatibility with old wallets282In order to easily represent the sets of scripts currently supported by283existing Bitcoin Core wallets, a convenience function `combo` is284provided, which takes as input a public key, and describes a set of P2PK,285P2PKH, P2WPKH, and P2SH-P2WPKH scripts for that key. In case the key is286uncompressed, the set only includes P2PK and P2PKH scripts.288### Checksums290Descriptors can optionally be suffixed with a checksum to protect against291typos or copy-paste errors.293These checksums consist of 8 alphanumeric characters. As long as errors are294restricted to substituting characters in `0123456789()[],'/*abcdefgh@:$%{}`295for others in that set and changes in letter case, up to 4 errors will always296be detected in descriptors up to 501 characters, and up to 3 errors in longer297ones. For larger numbers of errors, or other types of errors, there is a298roughly 1 in a trillion chance of not detecting the errors.300All RPCs in Bitcoin Core will include the checksum in their output. Only301certain RPCs require checksums on input, including `deriveaddresses` and302`importdescriptors`. The checksum for a descriptor without one can be computed303using the `getdescriptorinfo` RPC.
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.