|
| 1 | +<pre> |
| 2 | + BIP: 385 |
| 3 | + Layer: Applications |
| 4 | + Title: raw() and addr() Output Script Descriptors |
| 5 | + Author: Pieter Wuille < [email protected]> |
| 6 | + |
| 7 | + Comments-Summary: No comments yet. |
| 8 | + Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0385 |
| 9 | + Status: Draft |
| 10 | + Type: Informational |
| 11 | + Created: 2021-06-27 |
| 12 | + License: BSD-2-Clause |
| 13 | +</pre> |
| 14 | + |
| 15 | +==Abstract== |
| 16 | + |
| 17 | +This document specifies <tt>raw()</tt> and <tt>addr()</tt> output script descriptors. |
| 18 | +<tt>raw()</tt> encapsulates a raw script as a descriptor. |
| 19 | +<tt>addr()</tt> encapsulates an address as a descriptor. |
| 20 | + |
| 21 | +==Copyright== |
| 22 | + |
| 23 | +This BIP is licensed under the BSD 2-clause license. |
| 24 | + |
| 25 | +==Motivation== |
| 26 | + |
| 27 | +In order to make descriptors maximally compatible with scripts in use today, it is useful to be able to wrap any arbitrary output script or an address into a descriptor. |
| 28 | + |
| 29 | +==Specification== |
| 30 | + |
| 31 | +Two new script expressions are defined: <tt>raw()</tt> and <tt>addr()</tt>. |
| 32 | + |
| 33 | +===<tt>raw()</tt>=== |
| 34 | + |
| 35 | +The <tt>raw(HEX)</tt> expression can only be used as a top level descriptor. |
| 36 | +As the argument, it takes a hex string representing a Bitcoin script. |
| 37 | +The output script produced by this descriptor is the script represented by <tt>HEX</tt>. |
| 38 | + |
| 39 | +===<tt>addr()</tt>=== |
| 40 | + |
| 41 | +The <tt>addr(ADDR)</tt> expression can only be used as a top level descriptor. |
| 42 | +It takes an address as its single argument. |
| 43 | +The output script produced by this descriptor is the output script produced by the address <tt>ADDR</tt>. |
| 44 | + |
| 45 | +==Test Vectors== |
| 46 | + |
| 47 | +TBD |
| 48 | + |
| 49 | +==Backwards Compatibility== |
| 50 | + |
| 51 | +<tt>raw()</tt> and <tt>addr()</tt> descriptors use the format and general operation specified in [[bip-0380.mediawiki|380]]. |
| 52 | +As this is a wholly new descriptor, it is not compatible with any implementation. |
| 53 | +The reuse of existing Bitcoin addresses allows for this to be more easily implemented. |
| 54 | + |
| 55 | +==Reference Implemntation== |
| 56 | + |
| 57 | +<tt>raw()</tt> and <tt>addr</tt> descriptors have been implemented in Bitcoin Core since version 0.17. |
0 commit comments