BIP 0385

From Bitcoin Wiki
Revision as of 13:33, 26 December 2021 by 934 (talk | contribs) (Update BIP text with latest version from
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes a BIP (Bitcoin Improvement Proposal).
Please see BIP 2 for more information about BIPs and creating them. Please do not just create a wiki page.

Please do not modify this page. This is a mirror of the BIP from the source Git repository here.

  BIP: 385
  Layer: Applications
  Title: raw() and addr() Output Script Descriptors
  Author: Pieter Wuille <>
          Andrew Chow <>
  Comments-Summary: No comments yet.
  Status: Draft
  Type: Informational
  Created: 2021-06-27
  License: BSD-2-Clause


This document specifies raw() and addr() output script descriptors. raw() encapsulates a raw script as a descriptor. addr() encapsulates an address as a descriptor.


This BIP is licensed under the BSD 2-clause license.


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.


Two new script expressions are defined: raw() and addr().


The raw(HEX) expression can only be used as a top level descriptor. As the argument, it takes a hex string representing a Bitcoin script. The output script produced by this descriptor is the script represented by HEX.


The addr(ADDR) expression can only be used as a top level descriptor. It takes an address as its single argument. The output script produced by this descriptor is the output script produced by the address ADDR.

Test Vectors


Backwards Compatibility

raw() and addr() descriptors use the format and general operation specified in 380. As this is a wholly new descriptor, it is not compatible with any implementation. The reuse of existing Bitcoin addresses allows for this to be more easily implemented.

Reference Implementation

raw() and addr() descriptors have been implemented in Bitcoin Core since version 0.17.