Skip to content

Commit 5403ff9

Browse files
committed
Specify BIP 385: Raw and addr descriptors
1 parent f52f1e8 commit 5403ff9

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

README.mediawiki

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,13 @@ Those proposing changes should consider that ultimately consent may rest with th
10851085
| Pieter Wuille, Andrew Chow
10861086
| Informational
10871087
| Draft
1088+
|-
1089+
| [[bip-0385.mediawiki|385]]
1090+
| Applications
1091+
| raw() and addr() Output Script Descriptors
1092+
| Pieter Wuille, Andrew Chow
1093+
| Informational
1094+
| Draft
10881095
|}
10891096

10901097
<!-- IMPORTANT! See the instructions at the top of this page, do NOT JUST add BIPs here! -->

bip-0380.mediawiki

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,10 @@ This Table lists all available Script expressions and the BIPs specifying them.
261261
|-
262262
| <tt>combo(KEY)</tt>
263263
| [[bip-0384.mediawiki|384]]
264+
|-
265+
| <tt>raw(HEX)</tt>
266+
| [[bip-0385.mediawiki|385]]
267+
|-
268+
| <tt>addr(ADDR)</tt>
269+
| [[bip-0385.mediawiki|385]]
264270
|}

bip-0385.mediawiki

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<pre>
2+
BIP: 385
3+
Layer: Applications
4+
Title: raw() and addr() Output Script Descriptors
5+
Author: Pieter Wuille <[email protected]>
6+
Andrew Chow <[email protected]>
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

Comments
 (0)