{"number":380,"title":"Output Script Descriptors General Operation","authors":["Pieter Wuille","Ava Chow"],"status":"Deployed","type":"Specification","layer":"Applications","created":"2021-06-27","license":"BSD-2-Clause","requires":[],"replaces":[],"replacedBy":[],"discussion":[],"abstract":"Output Script Descriptors are a simple language which can be used to describe collections of output scripts. There can be many different descriptor fragments and functions. This document describes the general syntax for descriptors, descriptor checksums, and common expressions.","eli5":"Output script descriptors are a compact text language for describing exactly which addresses a wallet owns and how they are spent. This document defines their general syntax and checksum, giving wallets a standard way to back up and share wallet setups precisely.","categories":["encoding"],"filename":"bip-0380.mediawiki","githubUrl":"https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki","format":"mediawiki","readingMinutes":10,"inbound":16,"revisions":27,"impact":99,"core":true,"references":[381,382,383,384,385,386,390,392],"lastModified":"2026-09-17","html":"<h2 id=\"abstract\">Abstract</h2>\n<p>Output Script Descriptors are a simple language which can be used to describe collections of output scripts. There can be many different descriptor fragments and functions. This document describes the general syntax for descriptors, descriptor checksums, and common expressions.</p>\n<h2 id=\"copyright\">Copyright</h2>\n<p>This BIP is licensed under the BSD 2-clause license.</p>\n<h2 id=\"motivation\">Motivation</h2>\n<p>Bitcoin wallets traditionally have stored a set of keys which are later serialized and mutated to produce the output scripts that the wallet watches and the addresses it provides to users. Typically backups have consisted of solely the private keys, nowadays primarily in the form of BIP 39 mnemonics. However this backup solution is insufficient, especially since the introduction of Segregated Witness which added new output types. Given just the private keys, it is not possible for restored wallets to know which kinds of output scripts and addresses to produce. This has lead to incompatibilities between wallets when restoring a backup or exporting data for a watch only wallet.</p>\n<p>Further complicating matters are BIP 32 derivation paths. Although BIPs 44, 49, and 84 have specified standard BIP 32 derivation paths for different output scripts and addresses, not all wallets support those derivation paths nor use them. The lack of derivation path information in these backups and exports leads to further incompatibilities between wallets.</p>\n<p>Current solutions to these issues have not been generic and can be viewed as being layer violations. Solutions such as introducing different version bytes for extended key serialization both are a layer violation (key derivation should be separate from script type meaning) and specific only to a particular derivation path and script type.</p>\n<p>Output Script Descriptors introduce a generic solution to these issues. Script types are specified explicitly through the use of Script Expressions. Key derivation paths are specified explicitly in Key Expressions. These allow for creating wallet backups and exports which specify the exact scripts, subscripts (redeemScript, witnessScript, etc.), and keys to produce. With the general structure specified in this BIP, new Script Expressions can be introduced as new script types are added. Lastly, the use of common terminology and existing standards allow for Output Script Descriptors to be engineer readable so that the results can be understood at a glance.</p>\n<h2 id=\"specification\">Specification</h2>\n<p>Descriptors consist of several types of expressions. The top level expression is a <code>SCRIPT</code>. This expression may be followed by <code>#CHECKSUM</code>, where <code>CHECKSUM</code> is an 8 character alphanumeric descriptor checksum. Although the checksum is optional for parsing, applications may choose to reject descriptors that do not contain a checksum.</p>\n<h3 id=\"script-expressions\">Script Expressions</h3>\n<p>Script Expressions (denoted <code>SCRIPT</code>) are expressions which correspond directly with a Bitcoin script. These expressions are written as functions and take arguments. Such expressions have a script template which is filled with the arguments correspondingly. Expressions are written with a human readable identifier string with the arguments enclosed with parentheses. The identifier string should be alphanumeric and may include underscores.</p>\n<p>The arguments to a script expression are defined by that expression itself. They could be a script expression, a key expression, or some other expression entirely.</p>\n<h3 id=\"key-expressions\">Key Expressions</h3>\n<p>A common expression used as an argument to script expressions are key expressions (denoted <code>KEY</code>). These represent a public or private key and, optionally, information about the origin of that key. Key expressions can only be used as arguments to script expressions.</p>\n<p>Key expressions consist of:</p>\n<ul><li>\nOptionally, key origin information, consisting of:\n<ul><li>\nAn open bracket <code>[</code>\n</li></ul>\n<ul><li>\nExactly 8 hex characters for the fingerprint of the key where the derivation starts (see BIP 32 for details)\n</li></ul>\n<ul><li>\nFollowed by zero or more <code>/NUM</code> or <code>/NUMh</code>  path elements to indicate the unhardened or hardened derivation steps between the fingerprint and the key that follows.\n</li></ul>\n<ul><li>\nA closing bracket <code>]</code>\n</li></ul>\n</li><li>\nFollowed by the actual key, which is either:\n<ul><li>\nA hex encoded public key, which depending on the script expression, may be either:\n<ul><li>\n66 hex character string beginning with <code>02</code> or <code>03</code> representing a compressed public key\n</li></ul>\n<ul><li>\n130 hex character string beginning with <code>04</code> representing an uncompressed public key\n</li></ul>\n</li><li>\nA <a href=\"https://en.bitcoin.it/wiki/Wallet_import_format\">WIF</a> encoded private key\n</li></ul>\n<ul><li>\n<code>xpub</code> encoded extended public key or <code>xprv</code> encoded extended private key (as defined in BIP 32)\n<ul><li>\nFollowed by zero or more <code>/NUM</code> or <code>/NUMh</code> path elements indicating BIP 32 derivation steps to be taken after the given extended key.\n</li></ul>\n<ul><li>\nOptionally followed by a single <code>/*</code> or <code>/*h</code> final step to denote all direct unhardened or hardened children.\n</li></ul>\n</li></ul>\n</li></ul>\n<p>If the <code>KEY</code> is a BIP 32 extended key, before output scripts can be created, child keys must be derived using the derivation information that follows the extended key. When the final step is <code>/*</code> or <code>/*'</code>, an output script will be produced for every child key index. The derived key must be not be serialized as an uncompressed public key. Script Expressions may have further requirements on how derived public keys are serialized for script creation.</p>\n<p>In the above specification, the hardened indicator <code>h</code> may be replaced with alternative hardened indicator of <code>'</code>.</p>\n<h4 id=\"normalization-of-key-expressions-with-hardened-derivation\">Normalization of Key Expressions with Hardened Derivation</h4>\n<p>When a descriptor is exported without private keys, it is necessary to do additional derivation to remove any intermediate hardened derivation steps for the exported descriptor to be useful. The exporter should derive the extended public key at the last hardened derivation step and use that extended public key as the key in the descriptor. The derivation steps that were taken to get to that key must be added to the previous key origin information. If there is no key origin information, then one must be added for the newly derived extended public key. If the final derivation is hardened, then it is not necessary to do additional derivation.</p>\n<h3 id=\"character-set\">Character Set</h3>\n<p>The expressions used in descriptors must only contain characters within this character set so that the descriptor checksum will work.</p>\n<p>The allowed characters are:</p>\n<pre><code>0123456789()[],'/*abcdefgh@:$%{}\nIJKLMNOPQRSTUVWXYZ&+-.;&lt;=&gt;?!^_|~\nijklmnopqrstuvwxyzABCDEFGH`#\"\\&lt;space&gt;</code></pre>\n<p>Note that <code>&lt;space&gt;</code> on the last line is a space character.</p>\n<p>This character set is written as 3 groups of 32 characters in this specific order so that the checksum below can identify more errors. The first group are the most common \"unprotected\" characters (i.e. things such as hex and keypaths that do not already have their own checksums). Case errors cause an offset that is a multiple of 32 while as many alphabetic characters are in the same group while following the previous restrictions.</p>\n<h3 id=\"checksum\">Checksum</h3>\n<p>Following the top level script expression is a single octothorpe (<code>#</code>) followed by the 8 character checksum. The checksum is an error correcting checksum similar to bech32.</p>\n<p>The checksum has the following properties:</p>\n<ul><li>\nMistakes in a descriptor string are measured in \"symbol errors\". The higher the number of symbol errors, the harder it is to detect:\n<ul><li>\nAn error substituting a character from <code>0123456789()[],'/*abcdefgh@:$%{}</code> for another in that set always counts as 1 symbol error.\n<ul><li>\nNote that hex encoded keys are covered by these characters. Extended keys (<code>xpub</code> and <code>xprv</code>) use other characters too, but also have their own checksum mechanism.\n</li></ul>\n<ul><li>\n<code>SCRIPT</code> expression function names use other characters, but mistakes in these would generally result in an unparsable descriptor.\n</li></ul>\n</li><li>\nA case error always counts as 1 symbol error.\n</li></ul>\n<ul><li>\nAny other 1 character substitution error counts as 1 or 2 symbol errors.\n</li></ul>\n</li><li>\nAny 1 symbol error is always detected.\n</li></ul>\n<ul><li>\nAny 2 or 3 symbol error in a descriptor of up to 49154 characters is always detected.\n</li></ul>\n<ul><li>\nAny 4 symbol error in a descriptor of up to 507 characters is always detected.\n</li></ul>\n<ul><li>\nAny 5 symbol error in a descriptor of up to 77 characters is always detected.\n</li></ul>\n<ul><li>\nIs optimized to minimize the chance of a 5 symbol error in a descriptor up to 387 characters is undetected\n</li></ul>\n<ul><li>\nRandom errors have a chance of 1 in 2<super>40</super> of being undetected.\n</li></ul>\n<p>The checksum itself uses the same character set as bech32: <code>qpzry9x8gf2tvdw0s3jn54khce6mua7l</code></p>\n<p>Valid descriptor strings with a checksum must pass the criteria for validity specified by the Python3 code snippet below. The function <code>descsum_check</code> must return true when its argument <code>s</code> is a descriptor consisting in the form <code>SCRIPT#CHECKSUM</code>.</p>\n<pre><code>INPUT_CHARSET = \"0123456789()[],'/*abcdefgh@:$%{}IJKLMNOPQRSTUVWXYZ&+-.;&lt;=&gt;?!^_|~ijklmnopqrstuvwxyzABCDEFGH`#\\\"\\\\ \"\nCHECKSUM_CHARSET = \"qpzry9x8gf2tvdw0s3jn54khce6mua7l\"\nGENERATOR = [0xf5dee51989, 0xa9fdca3312, 0x1bab10e32d, 0x3706b1677a, 0x644d626ffd]\n\ndef descsum_polymod(symbols):\n    \"\"\"Internal function that computes the descriptor checksum.\"\"\"\n    chk = 1\n    for value in symbols:\n        top = chk &gt;&gt; 35\n        chk = (chk & 0x7ffffffff) &lt;&lt; 5 ^ value\n        for i in range(5):\n            chk ^= GENERATOR[i] if ((top &gt;&gt; i) & 1) else 0\n    return chk\n\ndef descsum_expand(s):\n    \"\"\"Internal function that does the character to symbol expansion\"\"\"\n    groups = []\n    symbols = []\n    for c in s:\n        if not c in INPUT_CHARSET:\n            return None\n        v = INPUT_CHARSET.find(c)\n        symbols.append(v & 31)\n        groups.append(v &gt;&gt; 5)\n        if len(groups) == 3:\n            symbols.append(groups[0] * 9 + groups[1] * 3 + groups[2])\n            groups = []\n    if len(groups) == 1:\n        symbols.append(groups[0])\n    elif len(groups) == 2:\n        symbols.append(groups[0] * 3 + groups[1])\n    return symbols\n\ndef descsum_check(s):\n    \"\"\"Verify that the checksum is correct in a descriptor\"\"\"\n    if s[-9] != '#':\n        return False\n    if not all(x in CHECKSUM_CHARSET for x in s[-8:]):\n        return False\n    symbols = descsum_expand(s[:-9]) + [CHECKSUM_CHARSET.find(x) for x in s[-8:]]\n    return descsum_polymod(symbols) == 1</code></pre>\n<p>This implements a BCH code that has the properties described above. The entire descriptor string is first processed into an array of symbols. The symbol for each character is its position within its group. After every 3rd symbol, a 4th symbol is inserted which represents the group numbers combined together. This means that a change that only affects the position within a group, or only a group number change, will only affect a single symbol.</p>\n<p>To construct a valid checksum given a script expression, the code below can be used:</p>\n<pre><code>def descsum_create(s):\n    \"\"\"Add a checksum to a descriptor without\"\"\"\n    symbols = descsum_expand(s) + [0, 0, 0, 0, 0, 0, 0, 0]\n    checksum = descsum_polymod(symbols) ^ 1\n    return s + '#' + ''.join(CHECKSUM_CHARSET[(checksum &gt;&gt; (5 * (7 - i))) & 31] for i in range(8))\n</code></pre>\n<h2 id=\"test-vectors\">Test Vectors</h2>\n<p>The following tests cover the checksum and character set:</p>\n<ul><li>\nValid checksum: <code>raw(deadbeef)#89f8spxm</code>\n</li></ul>\n<ul><li>\nNo checksum: <code>raw(deadbeef)</code>\n</li></ul>\n<ul><li>\nMissing checksum: <code>raw(deadbeef)#</code>\n</li></ul>\n<ul><li>\nToo long checksum (9 chars): <code>raw(deadbeef)#89f8spxmx</code>\n</li></ul>\n<ul><li>\nToo short checksum (7 chars): <code>raw(deadbeef)#89f8spx</code>\n</li></ul>\n<ul><li>\nError in payload: <code>raw(deedbeef)#89f8spxm</code>\n</li></ul>\n<ul><li>\nError in checksum: <code>raw(deedbeef)##9f8spxm</code>\n</li></ul>\n<ul><li>\nInvalid characters in payload: <code>raw(Ü)#00000000</code>\n</li></ul>\n<p>The following tests cover key expressions:</p>\n<p>Valid expressions:</p>\n<ul><li>\nCompressed public key: <code>0260b2003c386519fc9eadf2b5cf124dd8eea4c4e68d5e154050a9346ea98ce600</code>\n</li></ul>\n<ul><li>\nUncompressed public key: <code>04a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd5b8dec5235a0fa8722476c7709c02559e3aa73aa03918ba2d492eea75abea235</code>\n</li></ul>\n<ul><li>\nPublic key with key origin: <code>[deadbeef/0h/0h/0h]0260b2003c386519fc9eadf2b5cf124dd8eea4c4e68d5e154050a9346ea98ce600</code>\n</li></ul>\n<ul><li>\nPublic key with key origin (<code>'</code> as hardened indicator): <code>[deadbeef/0'/0'/0']0260b2003c386519fc9eadf2b5cf124dd8eea4c4e68d5e154050a9346ea98ce600</code>\n</li></ul>\n<ul><li>\nPublic key with key origin (mixed hardened indicator): <code>[deadbeef/0'/0h/0']0260b2003c386519fc9eadf2b5cf124dd8eea4c4e68d5e154050a9346ea98ce600</code>\n</li></ul>\n<ul><li>\nWIF uncompressed private key <code>5KYZdUEo39z3FPrtuX2QbbwGnNP5zTd7yyr2SC1j299sBCnWjss</code>\n</li></ul>\n<ul><li>\nWIF compressed private key <code>L4rK1yDtCWekvXuE6oXD9jCYfFNV2cWRpVuPLBcCU2z8TrisoyY1</code>\n</li></ul>\n<ul><li>\nExtended public key: <code>xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL</code>\n</li></ul>\n<ul><li>\nExtended public key with key origin: <code>[deadbeef/0h/1h/2h]xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL</code>\n</li></ul>\n<ul><li>\nExtended public key with derivation: <code>[deadbeef/0h/1h/2h]xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/3/4/5</code>\n</li></ul>\n<ul><li>\nExtended public key with derivation and children: <code>[deadbeef/0h/1h/2h]xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/3/4/5/*</code>\n</li></ul>\n<ul><li>\nExtended public key with hardened derivation and unhardened children: <code>xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/3h/4h/5h/*</code>\n</li></ul>\n<ul><li>\nExtended public key with hardened derivation and children: <code>xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/3h/4h/5h/*h</code>\n</li></ul>\n<ul><li>\nExtended public key with key origin, hardened derivation and children: <code>[deadbeef/0h/1h/2]xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/3h/4h/5h/*h</code>\n</li></ul>\n<ul><li>\nExtended private key: <code>xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc</code>\n</li></ul>\n<ul><li>\nExtended private key with key origin: <code>[deadbeef/0h/1h/2h]xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc</code>\n</li></ul>\n<ul><li>\nExtended private key with derivation: <code>[deadbeef/0h/1h/2h]xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc/3/4/5</code>\n</li></ul>\n<ul><li>\nExtended private key with derivation and children: <code>[deadbeef/0h/1h/2h]xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc/3/4/5/*</code>\n</li></ul>\n<ul><li>\nExtended private key with hardened derivation and unhardened children: <code>xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc/3h/4h/5h/*</code>\n</li></ul>\n<ul><li>\nExtended private key with hardened derivation and children: <code>xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc/3h/4h/5h/*h</code>\n</li></ul>\n<ul><li>\nExtended private key with key origin, hardened derivation and children: <code>[deadbeef/0h/1h/2]xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc/3h/4h/5h/*h</code>\n</li></ul>\n<p>Invalid expression:</p>\n<ul><li>\nChildren indicator in key origin: <code>[deadbeef/0h/0h/0h/*]0260b2003c386519fc9eadf2b5cf124dd8eea4c4e68d5e154050a9346ea98ce600</code>\n</li></ul>\n<ul><li>\nTrailing slash in key origin: <code>[deadbeef/0h/0h/0h/]0260b2003c386519fc9eadf2b5cf124dd8eea4c4e68d5e154050a9346ea98ce600</code>\n</li></ul>\n<ul><li>\nToo short fingerprint: <code>[deadbef/0h/0h/0h]0260b2003c386519fc9eadf2b5cf124dd8eea4c4e68d5e154050a9346ea98ce600</code>\n</li></ul>\n<ul><li>\nToo long fingerprint: <code>[deadbeeef/0h/0h/0h]0260b2003c386519fc9eadf2b5cf124dd8eea4c4e68d5e154050a9346ea98ce600</code>\n</li></ul>\n<ul><li>\nInvalid hardened indicators: <code>[deadbeef/0f/0f/0f]0260b2003c386519fc9eadf2b5cf124dd8eea4c4e68d5e154050a9346ea98ce600</code>\n</li></ul>\n<ul><li>\nInvalid hardened indicators: <code>[deadbeef/-0/-0/-0]0260b2003c386519fc9eadf2b5cf124dd8eea4c4e68d5e154050a9346ea98ce600</code>\n</li></ul>\n<ul><li>\nInvalid hardened indicators: <code>[deadbeef/0H/0H/0H]0260b2003c386519fc9eadf2b5cf124dd8eea4c4e68d5e154050a9346ea98ce600</code>\n</li></ul>\n<ul><li>\nInvalid hardened indicators: <code>[deadbeef/0h/1h/2]xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc/3H/4h/5h/*H</code>\n</li></ul>\n<ul><li>\nPrivate key with derivation: <code>L4rK1yDtCWekvXuE6oXD9jCYfFNV2cWRpVuPLBcCU2z8TrisoyY1/0</code>\n</li></ul>\n<ul><li>\nPrivate key with derivation children: <code>L4rK1yDtCWekvXuE6oXD9jCYfFNV2cWRpVuPLBcCU2z8TrisoyY1/*</code>\n</li></ul>\n<ul><li>\nDerivation index out of range: <code>xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U/2147483648</code>\n</li></ul>\n<ul><li>\nInvalid derivation index: <code>xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U/1aa</code>\n</li></ul>\n<ul><li>\nMultiple key origins: <code>[aaaaaaaa][aaaaaaaa]xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U/2147483647'/0</code>\n</li></ul>\n<ul><li>\nMissing key origin start: <code>aaaaaaaa]xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U/2147483647'/0</code>\n</li></ul>\n<ul><li>\nNon hex fingerprint: <code>[gaaaaaaa]xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U/2147483647'/0</code>\n</li></ul>\n<ul><li>\nKey origin with no public key: <code>[deadbeef]</code>\n</li></ul>\n<h2 id=\"backwards-compatibility\">Backwards Compatibility</h2>\n<p>Output script descriptors are an entirely new language which is not compatible with any existing software. However many components of the expressions reuse encodings and serializations defined by previous BIPs.</p>\n<p>Output script descriptors are designed for future extension with further fragment types and new script expressions. These will be specified in additional BIPs.</p>\n<h2 id=\"reference-implementation\">Reference Implementation</h2>\n<p>Descriptors have been implemented in Bitcoin Core since version 0.17.</p>\n<h2 id=\"appendix-a-index-of-expressions\">Appendix A: Index of Expressions</h2>\n<p>Future BIPs may specify additional types of expressions. All available expression types are listed in this table.</p>\n<div class=\"table-wrap\"><table><tbody><tr><th>Name</th><th>Denoted As</th><th>BIP</th></tr><tr><td>Script</td><td><code>SCRIPT</code></td><td>380</td></tr><tr><td>Key</td><td><code>KEY</code></td><td>380</td></tr><tr><td>Tree</td><td><code>TREE</code></td><td><a href=\"/bip/386\">386</a></td></tr><tr><td>Annotation</td><td><code>ANNOT</code></td><td><a href=\"https://github.com/bitcoin/bips/blob/master/bip-descriptorannotations.mediawiki\">?</a></td></tr></tbody></table></div>\n<h2 id=\"appendix-b-index-of-script-expressions\">Appendix B: Index of Script Expressions</h2>\n<p>Script expressions will be specified in additional BIPs. This Table lists all available Script expressions and the BIPs specifying them.</p>\n<div class=\"table-wrap\"><table><tbody><tr><th>Expression</th><th>BIP</th></tr><tr><td><code>pk(KEY)</code></td><td><a href=\"/bip/381\">381</a></td></tr><tr><td><code>pkh(KEY)</code></td><td><a href=\"/bip/381\">381</a></td></tr><tr><td><code>sh(SCRIPT)</code></td><td><a href=\"/bip/381\">381</a></td></tr><tr><td><code>wpkh(KEY)</code></td><td><a href=\"/bip/382\">382</a></td></tr><tr><td><code>wsh(SCRIPT)</code></td><td><a href=\"/bip/382\">382</a></td></tr><tr><td><code>multi(NUM, KEY, ..., KEY)</code></td><td><a href=\"/bip/383\">383</a></td></tr><tr><td><code>sortedmulti(NUM, KEY, ..., KEY)</code></td><td><a href=\"/bip/383\">383</a></td></tr><tr><td><code>combo(KEY)</code></td><td><a href=\"/bip/384\">384</a></td></tr><tr><td><code>raw(HEX)</code></td><td><a href=\"/bip/385\">385</a></td></tr><tr><td><code>addr(ADDR)</code></td><td><a href=\"/bip/385\">385</a></td></tr><tr><td><code>tr(KEY)</code>, <code>tr(KEY, TREE)</code></td><td><a href=\"/bip/386\">386</a></td></tr><tr><td><code>musig(KEY, KEY, ..., KEY)</code></td><td><a href=\"/bip/390\">390</a></td></tr><tr><td><code>sp(KEY)</code>, <code>sp(KEY, KEY)</code></td><td><a href=\"/bip/392\">392</a></td></tr></tbody></table></div>","toc":[{"id":"abstract","title":"Abstract","level":2},{"id":"copyright","title":"Copyright","level":2},{"id":"motivation","title":"Motivation","level":2},{"id":"specification","title":"Specification","level":2},{"id":"script-expressions","title":"Script Expressions","level":3},{"id":"key-expressions","title":"Key Expressions","level":3},{"id":"normalization-of-key-expressions-with-hardened-derivation","title":"Normalization of Key Expressions with Hardened Derivation","level":4},{"id":"character-set","title":"Character Set","level":3},{"id":"checksum","title":"Checksum","level":3},{"id":"test-vectors","title":"Test Vectors","level":2},{"id":"backwards-compatibility","title":"Backwards Compatibility","level":2},{"id":"reference-implementation","title":"Reference Implementation","level":2},{"id":"appendix-a-index-of-expressions","title":"Appendix A: Index of Expressions","level":2},{"id":"appendix-b-index-of-script-expressions","title":"Appendix B: Index of Script Expressions","level":2}],"history":{"totalCommits":27,"firstCommit":"2021-06-27T17:20:21-04:00","lastUpdated":"2026-09-17T15:01:36+02:00","events":[{"sha":"93607da01df07348dcd37ddf62d3cae350436783","date":"2026-09-17T15:01:36+02:00","author":"Daniela Brozzoni","message":"bip380: Update to Specification type","url":"https://github.com/bitcoin/bips/commit/93607da01df07348dcd37ddf62d3cae350436783","kind":"edit"},{"sha":"6c2023e542afa77a728186ba6a9197fdf6050f35","date":"2026-04-07T17:31:42+02:00","author":"craigraw","message":"Merge pull request #2099 from craigraw/descriptorannotations","url":"https://github.com/bitcoin/bips/commit/6c2023e542afa77a728186ba6a9197fdf6050f35","kind":"edit"},{"sha":"41f99576308d192526093a39718fff842692d13c","date":"2026-03-05T18:02:52+02:00","author":"craigraw","message":"BIP392: Silent Payment Output Script Descriptors (#2047)","url":"https://github.com/bitcoin/bips/commit/41f99576308d192526093a39718fff842692d13c","kind":"edit"},{"sha":"24e96e870fffaa257b465ce1f0370c14aac588e8","date":"2025-10-08T14:59:36-07:00","author":"Murch","message":"process: Created ↦ Assigned","url":"https://github.com/bitcoin/bips/commit/24e96e870fffaa257b465ce1f0370c14aac588e8","kind":"edit"},{"sha":"5207ef92a52d0b8902895b0dbb40823a4d698ec9","date":"2025-04-11T20:08:17-07:00","author":"Murch","message":"process: Author ↦ Authors","url":"https://github.com/bitcoin/bips/commit/5207ef92a52d0b8902895b0dbb40823a4d698ec9","kind":"edit"},{"sha":"59730dec4fb641a41589aa1b91d3c452f13e0e36","date":"2025-04-11T20:05:13-07:00","author":"Murch","message":"process: Remove Comments-URI and -Summary","url":"https://github.com/bitcoin/bips/commit/59730dec4fb641a41589aa1b91d3c452f13e0e36","kind":"edit"},{"sha":"5d3ceb37734f80b2ec206fc94245e3bfd6d5b0f0","date":"2025-04-11T18:08:44-07:00","author":"Murch","message":"process: Final/Active ↦ Deployed","url":"https://github.com/bitcoin/bips/commit/5d3ceb37734f80b2ec206fc94245e3bfd6d5b0f0","kind":"status"},{"sha":"3cc71d7c22e941987e1c79cae64f08d989a1e62b","date":"2025-07-01T14:28:30-07:00","author":"Ava Chow","message":"380: Disallow H as a hardened indicator","url":"https://github.com/bitcoin/bips/commit/3cc71d7c22e941987e1c79cae64f08d989a1e62b","kind":"edit"},{"sha":"fade15caa2142132ff153294d5c17459d5ae6206","date":"2025-03-29T15:58:33+01:00","author":"quapka","message":"BIP380: minor grammar fixups (#1802)","url":"https://github.com/bitcoin/bips/commit/fade15caa2142132ff153294d5c17459d5ae6206","kind":"edit"},{"sha":"3d7ff96d7b0ddeea5b07a0d5e632207a6239d566","date":"2025-03-27T21:43:12+01:00","author":"quapka","message":"Make specs consistent about hardened indicators","url":"https://github.com/bitcoin/bips/commit/3d7ff96d7b0ddeea5b07a0d5e632207a6239d566","kind":"edit"},{"sha":"9a56d3544eac1f949a747c251810f7a440d63fb9","date":"2024-07-25T18:35:39+03:00","author":"Orfeas Stefanos Thyfronitis Litos","message":"Remove trailing whitespace from all BIPs","url":"https://github.com/bitcoin/bips/commit/9a56d3544eac1f949a747c251810f7a440d63fb9","kind":"edit"},{"sha":"d71428ade56ad9a90e18d643eefefefb6088fbd7","date":"2024-07-10T19:02:19-04:00","author":"Ava Chow","message":"380-387: Mark basic descriptor BIPs as final","url":"https://github.com/bitcoin/bips/commit/d71428ade56ad9a90e18d643eefefefb6088fbd7","kind":"status"},{"sha":"6b9138c1a1511719eb0477d2375c81a598ba07a0","date":"2024-01-15T14:07:44-05:00","author":"Ava Chow","message":"BIP 390: Add MuSig2 descriptor BIP","url":"https://github.com/bitcoin/bips/commit/6b9138c1a1511719eb0477d2375c81a598ba07a0","kind":"edit"},{"sha":"109811e4b95168159155a98afb6229c8065a65ea","date":"2024-04-01T13:33:48-05:00","author":"Chris Stewart","message":"Fix BIP380 typos","url":"https://github.com/bitcoin/bips/commit/109811e4b95168159155a98afb6229c8065a65ea","kind":"edit"},{"sha":"3671465ce62f91c6e115ec870b2b66e91b0cac43","date":"2023-11-09T21:06:22+08:00","author":"momodaka","message":"Update BIP-380: fix typo","url":"https://github.com/bitcoin/bips/commit/3671465ce62f91c6e115ec870b2b66e91b0cac43","kind":"edit"},{"sha":"a28b021b9933cb6b035cbb94fc1a15c30da3f6fd","date":"2023-12-13T11:12:08-05:00","author":"Ava Chow","message":"Update contact info for achow101","url":"https://github.com/bitcoin/bips/commit/a28b021b9933cb6b035cbb94fc1a15c30da3f6fd","kind":"edit"},{"sha":"c595d7c517c29138ac2ece3a5e147d5036f9276a","date":"2023-12-08T15:34:36+01:00","author":"Yannick Seurin","message":"correct fingerprint for invalid hardened indicators","url":"https://github.com/bitcoin/bips/commit/c595d7c517c29138ac2ece3a5e147d5036f9276a","kind":"edit"},{"sha":"bb562aa8e9c438e653668b08e5c16b7e71abc832","date":"2023-06-29T16:15:14-04:00","author":"Andrew Chow","message":"descriptors: add test vectors","url":"https://github.com/bitcoin/bips/commit/bb562aa8e9c438e653668b08e5c16b7e71abc832","kind":"edit"},{"sha":"272e1f5efcbce3ba38b8c4445f5e56b34e856d57","date":"2023-02-10T13:01:53-05:00","author":"Andrew Chow","message":"380: Clarify optionality of descriptor checksum","url":"https://github.com/bitcoin/bips/commit/272e1f5efcbce3ba38b8c4445f5e56b34e856d57","kind":"edit"},{"sha":"7007dbac006b8979c352f336039a47ffe32671c5","date":"2021-09-15T09:21:09-03:00","author":"jaonoctus","message":"typo: BIP [380-385]","url":"https://github.com/bitcoin/bips/commit/7007dbac006b8979c352f336039a47ffe32671c5","kind":"edit"},{"sha":"761ef12782dc02af48b3e3b5a5238faeec6870fe","date":"2021-06-29T16:33:02-04:00","author":"Andrew Chow","message":"Specify BIP 386: Taproot descriptors","url":"https://github.com/bitcoin/bips/commit/761ef12782dc02af48b3e3b5a5238faeec6870fe","kind":"edit"},{"sha":"5403ff90d69c82cb22b0a6f969f8c4ec601569b1","date":"2021-06-27T18:49:44-04:00","author":"Andrew Chow","message":"Specify BIP 385: Raw and addr descriptors","url":"https://github.com/bitcoin/bips/commit/5403ff90d69c82cb22b0a6f969f8c4ec601569b1","kind":"edit"},{"sha":"f52f1e82e52367ebbda2656845a71ad92a4ed677","date":"2021-06-27T18:49:41-04:00","author":"Andrew Chow","message":"Specify BIP 384: Combo descriptors","url":"https://github.com/bitcoin/bips/commit/f52f1e82e52367ebbda2656845a71ad92a4ed677","kind":"edit"},{"sha":"608f40b4980ab56bf3b95381c172791d39786223","date":"2021-06-27T20:27:33-04:00","author":"Andrew Chow","message":"Specify BIP 383: Multisig descriptors","url":"https://github.com/bitcoin/bips/commit/608f40b4980ab56bf3b95381c172791d39786223","kind":"edit"},{"sha":"fb56a18c890af8b269987b2e6664765ffc05a5c1","date":"2021-06-27T19:35:45-04:00","author":"Andrew Chow","message":"Specify BIP 382: Segwit descriptors","url":"https://github.com/bitcoin/bips/commit/fb56a18c890af8b269987b2e6664765ffc05a5c1","kind":"edit"},{"sha":"bd12ea7e9ddde4c7bd70bf3c4e13e98f941fcc4d","date":"2021-06-27T18:49:37-04:00","author":"Andrew Chow","message":"Specify BIP 381: Non-segwit descriptors","url":"https://github.com/bitcoin/bips/commit/bd12ea7e9ddde4c7bd70bf3c4e13e98f941fcc4d","kind":"edit"},{"sha":"71f435e76b074e55151a5aa99109290e8d0b6535","date":"2021-06-27T17:20:21-04:00","author":"Andrew Chow","message":"Specify BIP 380: Descriptors general operation","url":"https://github.com/bitcoin/bips/commit/71f435e76b074e55151a5aa99109290e8d0b6535","kind":"edit"}]}}