Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions README.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,13 @@ Those proposing changes should consider that ultimately consent may rest with th
| Ethan Kosakovsky
| Informational
| Draft
|-
| [[bip-0086.mediawiki|86]]
| Applications
| Key Derivation for Single Key P2TR Outputs
| Andrew Chow
| Standard
| Draft
|- style="background-color: #ffffcf"
| [[bip-0087.mediawiki|87]]
| Applications
Expand Down Expand Up @@ -1029,6 +1036,55 @@ Those proposing changes should consider that ultimately consent may rest with th
| Andrew Chow
| Standard
| Draft
|-
| [[bip-descriptors-general.mediawiki|bip-descriptors-general]]
| Applications
| Output Script Descriptors General Operation
| Pieter Wuille, Andrew Chow
| Informational
| Draft
|-
| [[bip-descriptors-non-segwit.mediawiki|bip-descriptors-non-segwit]]
| Applications
| Non-Segwit Output Script Descriptors
| Pieter Wuille, Andrew Chow
| Informational
| Draft
|-
| [[bip-descriptors-segwit.mediawiki|bip-descriptors-segwit]]
| Applications
| Segwit Output Script Descriptors
| Pieter Wuille, Andrew Chow
| Informational
| Draft
|-
| [[bip-descriptors-multi.mediawiki|bip-descriptors-multi]]
| Applications
| Multisig Output Script Descriptors
| Pieter Wuille, Andrew Chow
| Informational
| Draft
|-
| [[bip-descriptors-combo.mediawiki|bip-descriptors-combo]]
| Applications
| combo() Output Script Descriptors
| Pieter Wuille, Andrew Chow
| Informational
| Draft
|-
| [[bip-descriptors-raw-addr.mediawiki|bip-descriptors-raw-addr]]
| Applications
| raw() and addr() Output Script Descriptors
| Pieter Wuille, Andrew Chow
| Informational
| Draft
|-
| [[bip-descriptors-tr.mediawiki|bip-descriptors-tr]]
| Applications
| tr() Output Script Descriptors
| Pieter Wuille, Andrew Chow
| Informational
| Draft
|}

<!-- IMPORTANT! See the instructions at the top of this page, do NOT JUST add BIPs here! -->
2 changes: 1 addition & 1 deletion bip-0032.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ To shorten notation, we will write CKDpriv(CKDpriv(CKDpriv(m,3<sub>H</sub>),2),5
* N(m/a<sub>H</sub>/b/c) = N(m/a<sub>H</sub>/b)/c = N(m/a<sub>H</sub>)/b/c.
However, N(m/a<sub>H</sub>) cannot be rewritten as N(m)/a<sub>H</sub>, as the latter is not possible.

Each leaf node in the tree corresponds to an actual key, while the internal nodes correspond to the collections of keys that descend from them. The chain codes of the leaf nodes are ignored, and only their embedded private or public key is relevant. Because of this construction, knowing an extended private key allows reconstruction of all descendant private keys and public keys, and knowing an extended public keys allows reconstruction of all descendant non-hardened public keys.
Each leaf node in the tree corresponds to an actual key, while the internal nodes correspond to the collections of keys that descend from them. The chain codes of the leaf nodes are ignored, and only their embedded private or public key is relevant. Because of this construction, knowing an extended private key allows reconstruction of all descendant private keys and public keys, and knowing an extended public key allows reconstruction of all descendant non-hardened public keys.

===Key identifiers===

Expand Down
2 changes: 1 addition & 1 deletion bip-0039.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Haskell:
* https://github.com/NicolasDorier/NBitcoin

JavaScript:
* https://github.com/bitpay/bitcore-mnemonic
* https://github.com/bitpay/bitcore/tree/master/packages/bitcore-mnemonic
* https://github.com/bitcoinjs/bip39 (used by [[https://github.com/blockchain/My-Wallet-V3/blob/v3.8.0/src/hd-wallet.js#L121-L146|blockchain.info]])

Java:
Expand Down
128 changes: 128 additions & 0 deletions bip-0086.mediawiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<pre>
BIP: 86
Layer: Applications
Title: Key Derivation for Single Key P2TR Outputs
Author: Andrew Chow <andrew@achow101.com>
Comments-Summary: No comments yet.
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0086
Status: Draft
Type: Standards Track
Created: 2021-06-22
License: BSD-2-Clause
</pre>

==Abstract==

This document suggests a derivation scheme for HD wallets whose keys are involved in single key
P2TR ([[bip-0341.mediawiki|BIP 341]]) outputs as the Taproot internal key.

===Copyright===

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

==Motivation==

With the usage of single key P2TR transactions, it is useful to have a common derivation scheme so
that HD wallets that only have a backup of the HD seed can be likely to recover single key Taproot
outputs. Although there are now solutions which obviate the need for fixed derivation paths for
specific script types, many software wallets and hardware signers still use seed backups which
lack derivation path and script information. Thus we largely use the same approach used in BIPs
[[bip-0049.mediawiki|49]] and [[bip-0084.mediawiki|84]] for ease of implementation.

==Specifications==

This BIP defines the two needed steps to derive multiple deterministic addresses based on a
[[bip-0032.mediawiki|BIP 32]] master private key.

===Public key derivation===

To derive a public key from the root account, this BIP uses the same account-structure as
defined in BIPs [[bip-0044.mediawiki|44]], [[bip-0049.mediawiki|49]], and [[bip-0084.mediawiki|84]],
but with a different purpose value for the script type.

<pre>
m / purpose' / coin_type' / account' / change / address_index
</pre>

For the <tt>purpose</tt>-path level it uses <tt>86'</tt>.
The rest of the levels are used as defined in BIPs 44, 49, and 84.

A key derived with this derivation path pattern will be referred to as <tt>derived_key</tt> further
in this document.

===Address derivation===


[[bip-0341.mediawiki#cite_ref-22-0|BIP 341]] states: "If the spending conditions do not require a
script path, the output key should commit to an unspendable script path instead of having no
script path. This can be achieved by computing the output key point as
''Q = P + int(hash<sub>TapTweak</sub>(bytes(P)))G''." Thus:

<pre>
internal_key: lift_x(derived_key)
32_byte_output_key: internal_key + int(HashTapTweak(bytes(internal_key)))G
</pre>

In a transaction, the scripts and witnesses are as defined in
[[bip-0341.mediawiki#specification|BIP 341]]:

<pre>
witness: <signature>
scriptSig: (empty)
scriptPubKey: 1 <32_byte_output_key>
(0x5120{32_byte_output_key})
</pre>

==Backwards Compatibility==

This BIP is not backwards compatible by design.
An incompatible wallet will not discover these accounts at all and the user will notice that
something is wrong.

However this BIP uses the same method used in BIPs 44, 49, and 84, so it should not be difficult
to implement.

==Test vectors==

<pre>
mnemonic = abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about
rootpriv = xprv9s21ZrQH143K3GJpoapnV8SFfukcVBSfeCficPSGfubmSFDxo1kuHnLisriDvSnRRuL2Qrg5ggqHKNVpxR86QEC8w35uxmGoggxtQTPvfUu
rootpub = xpub661MyMwAqRbcFkPHucMnrGNzDwb6teAX1RbKQmqtEF8kK3Z7LZ59qafCjB9eCRLiTVG3uxBxgKvRgbubRhqSKXnGGb1aoaqLrpMBDrVxga8

// Account 0, root = m/86'/0'/0'
xprv = xprv9xgqHN7yz9MwCkxsBPN5qetuNdQSUttZNKw1dcYTV4mkaAFiBVGQziHs3NRSWMkCzvgjEe3n9xV8oYywvM8at9yRqyaZVz6TYYhX98VjsUk
xpub = xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ

// Account 0, first receiving address = m/86'/0'/0'/0/0
xprv = xprvA449goEeU9okwCzzZaxiy475EQGQzBkc65su82nXEvcwzfSskb2hAt2WymrjyRL6kpbVTGL3cKtp9herYXSjjQ1j4stsXXiRF7kXkCacK3T
xpub = xpub6H3W6JmYJXN49h5TfcVjLC3onS6uPeUTTJoVvRC8oG9vsTn2J8LwigLzq5tHbrwAzH9DGo6ThGUdWsqce8dGfwHVBxSbixjDADGGdzF7t2B
internal_key = cc8a4bc64d897bddc5fbc2f670f7a8ba0b386779106cf1223c6fc5d7cd6fc115
output_key = a60869f0dbcf1dc659c9cecbaf8050135ea9e8cdc487053f1dc6880949dc684c
scriptPubKey = 5120a60869f0dbcf1dc659c9cecbaf8050135ea9e8cdc487053f1dc6880949dc684c
address = bc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxqkedrcr

// Account 0, second receiving address = m/86'/0'/0'/0/1
xprv = xprvA449goEeU9okyiF1LmKiDaTgeXvmh87DVyRd35VPbsSop8n8uALpbtrUhUXByPFKK7C2yuqrB1FrhiDkEMC4RGmA5KTwsE1aB5jRu9zHsuQ
xpub = xpub6H3W6JmYJXN4CCKUSnriaiQRCZmG6aq4sCMDqTu1ACyngw7HShf59hAxYjXgKDuuHThVEUzdHrc3aXCr9kfvQvZPit5dnD3K9xVRBzjK3rX
internal_key = 83dfe85a3151d2517290da461fe2815591ef69f2b18a2ce63f01697a8b313145
output_key = a82f29944d65b86ae6b5e5cc75e294ead6c59391a1edc5e016e3498c67fc7bbb
scriptPubKey = 5120a82f29944d65b86ae6b5e5cc75e294ead6c59391a1edc5e016e3498c67fc7bbb
address = bc1p4qhjn9zdvkux4e44uhx8tc55attvtyu358kutcqkudyccelu0was9fqzwh

// Account 0, first change address = m/86'/0'/0'/1/0
xprv = xprvA3Ln3Gt3aphvUgzgEDT8vE2cYqb4PjFfpmbiFKphxLg1FjXQpkAk5M1ZKDY15bmCAHA35jTiawbFuwGtbDZogKF1WfjwxML4gK7WfYW5JRP
xpub = xpub6GL8SnQwRCGDhB59LEz9HMyM6sRYoByXBzXK3iEKWgCz8XrZNHUzd9L3AUBELW5NzA7dEFvMas1F84TuPH3xqdUA5tumaGWFgihJzWytXe3
internal_key = 399f1b2f4393f29a18c937859c5dd8a77350103157eb880f02e8c08214277cef
output_key = 882d74e5d0572d5a816cef0041a96b6c1de832f6f9676d9605c44d5e9a97d3dc
scriptPubKey = 5120882d74e5d0572d5a816cef0041a96b6c1de832f6f9676d9605c44d5e9a97d3dc
address = bc1p3qkhfews2uk44qtvauqyr2ttdsw7svhkl9nkm9s9c3x4ax5h60wqwruhk7
</pre>

==Reference==

* [[bip-0032.mediawiki|BIP32 - Hierarchical Deterministic Wallets]]
* [[bip-0043.mediawiki|BIP43 - Purpose Field for Deterministic Wallets]]
* [[bip-0044.mediawiki|BIP44 - Multi-Account Hierarchy for Deterministic Wallets]]
* [[bip-0049.mediawiki|BIP49 - Derivation scheme for P2WPKH-nested-in-P2SH based accounts]]
* [[bip-0084.mediawiki|BIP84 - Derivation scheme for P2WPKH based accounts]]
* [[bip-0341.mediawiki|BIP341 - Taproot: SegWit version 1 spending rules]]
2 changes: 1 addition & 1 deletion bip-0155.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ See the appendices for the address encodings to be used for the various networks

==Signaling support and compatibility==

Introduce a new message type <code>sendaddrv2</code>. Sending such a message indicates that a node can understand and prefers to receive <code>addrv2</code> messages instead of <code>addr</code> messages. I.e. "Send me addrv2".
Introduce a new message type <code>sendaddrv2</code>. Sending such a message indicates that a node can understand and prefers to receive <code>addrv2</code> messages instead of <code>addr</code> messages. I.e. "Send me addrv2". Sending or not sending this message does not imply any preference with respect to receiving unrequested address messages.

The <code>sendaddrv2</code> message MUST only be sent in response to the <code>version</code> message from a peer and prior to sending the <code>verack</code> message.

Expand Down
2 changes: 1 addition & 1 deletion bip-0174.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ determine which outputs are change outputs and verify that the change is returni
| [[bip-psb2.mediawiki|psbt2]]
|-
| Output Script
| <tt>PSBT_OUT_SCRIPT = 0x03</tt>
| <tt>PSBT_OUT_SCRIPT = 0x04</tt>
| None
| No key data
| <tt><script></tt>
Expand Down
2 changes: 1 addition & 1 deletion bip-0341.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ Non-upgraded nodes, however, will consider all SegWit version 1 witness programs
They are strongly encouraged to upgrade in order to fully validate the new programs.

Non-upgraded wallets can receive and send bitcoin from non-upgraded and upgraded wallets using SegWit version 0 programs, traditional pay-to-pubkey-hash, etc.
Depending on the implementation non-upgraded wallets may be able to send to Segwit version 1 programs if they support sending to [[bip-0173.mediawiki|BIP173]] Bech32 addresses.
Depending on the implementation non-upgraded wallets may be able to send to Segwit version 1 programs if they support sending to [[bip-0350.mediawiki|BIP350]] Bech32m addresses.

== Acknowledgements ==

Expand Down
2 changes: 1 addition & 1 deletion bip-0370.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ The new per-output types for PSBT Version 2 are defined as follows:
| 2
|-
| Output Script
| <tt>PSBT_OUT_SCRIPT = 0x03</tt>
| <tt>PSBT_OUT_SCRIPT = 0x04</tt>
| None
| No key data
| <tt><script></tt>
Expand Down
48 changes: 48 additions & 0 deletions bip-descriptors-combo.mediawiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<pre>
BIP: bip-descriptors-combo
Layer: Applications
Title: combo() Output Script Descriptors
Author: Pieter Wuille <pieter@wuille.net>
Andrew Chow <andrew@achow101.com>
Comments-Summary: No comments yet.
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-descriptors-combo
Status: Draft
Type: Informational
Created: 2021-06-27
License: BSD-2-Clause
</pre>

==Abstract==

This document specifies <tt>combo()</tt> output script descriptors.
These take a key and produce P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH output scripts if applicable to the key.

==Copyright==

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

==Motivation==

In order to make the transition from traditional key based wallets to descriptor based wallets easier, it is useful to be able to take a key and produce the scripts which have traditionally been produced by wallet software.

==Specification==

A new top level script expression is defined: <tt>combo(KEY)</tt>.
This expression can only be used as a top level expression.
It takes a single key expression as an argument and produces either 2 or 4 output scripts, depending on the key.
A <tt>combo()</tt> expression always produces a P2PK and P2PKH script, the same as putting the key in both a <tt>pk()</tt> and a <tt>pkh()</tt> expression.
If the key is/has a compressed public key, then P2WPKH and P2SH-P2WPKH scripts are also produced, the same as putting the key in both a <tt>wpkh()</tt> and <tt>sh(wpkh())</tt> expression.

==Test Vectors==

TBD

==Backwards Compatibility==

<tt>combo()</tt> descriptors use the format and general operation specified in [[bip-descriptor-general.mediawiki|bip-descriptor-general]].
As this is a wholly new descriptor, it is not compatible with any implementation.
However the scripts produced are standard scripts so existing software are likely to be familiar with them.

==Reference Implemntation==

<tt>combo</tt> descriptors have been implemented in Bitcoin Core since version 0.17.
Loading