Skip to content

Commit 1943927

Browse files
author
Matt David
committed
Merge remote-tracking branch 'upstream/master'
2 parents e3a155c + 1dedbfa commit 1943927

19 files changed

+942
-67
lines changed

README.mediawiki

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Those proposing changes should consider that ultimately consent may rest with th
2020
| Active
2121
|-
2222
| [[bip-0002.mediawiki|2]]
23-
| BIP Status and Comments
23+
| BIP process, revised
2424
| Luke Dashjr
2525
| Process
26-
| Deferred
26+
| Draft
2727
|- style="background-color: #cfffcf"
2828
| [[bip-0009.mediawiki|9]]
2929
| Version bits with timeout and delay
@@ -216,6 +216,12 @@ Those proposing changes should consider that ultimately consent may rest with th
216216
| Justus Ranvier
217217
| Informational
218218
| Draft
219+
|-
220+
| [[bip-0049.mediawiki|49]]
221+
| Derivation scheme for P2WPKH-nested-in-P2SH based accounts
222+
| Daniel Weigl
223+
| Informational
224+
| Draft
219225
|- style="background-color: #cfffcf"
220226
| [[bip-0050.mediawiki|50]]
221227
| March 2013 Chain Fork Post-Mortem
@@ -476,6 +482,12 @@ Those proposing changes should consider that ultimately consent may rest with th
476482
| Standard
477483
| Draft
478484
|-
485+
| [[bip-0134.mediawiki|134]]
486+
| Flexible Transactions
487+
| Tom Zander
488+
| Standard
489+
| Draft
490+
|-
479491
| [[bip-0140.mediawiki|140]]
480492
| Normalized TXID
481493
| Christian Decker
@@ -513,8 +525,14 @@ Those proposing changes should consider that ultimately consent may rest with th
513525
| Draft
514526
|-
515527
| [[bip-0146.mediawiki|146]]
516-
| Dealing with signature malleability
517-
| Pieter Wuille, Johnson Lau
528+
| Dealing with signature encoding malleability
529+
| Johnson Lau, Pieter Wuille
530+
| Standard
531+
| Draft
532+
|-
533+
| [[bip-0147.mediawiki|147]]
534+
| Dealing with dummy stack element malleability
535+
| Johnson Lau
518536
| Standard
519537
| Draft
520538
|-

bip-0002.mediawiki

Lines changed: 205 additions & 20 deletions
Large diffs are not rendered by default.

bip-0002/process.png

15.3 KB
Loading

bip-0002/process.svg

Lines changed: 49 additions & 0 deletions
Loading

bip-0009/assignments.mediawiki

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ State can be defined, active, failed. Dates are in UTC.
2727
|-
2828
| segwit
2929
| 1
30-
| TBD
31-
| TBD
30+
| 2016-11-15 00:00:00
31+
| 2017-11-15 00:00:00
3232
| -
3333
| 2016-05-01 00:00:00
3434
| 2017-05-01 00:00:00
3535
| active since #834624
36-
| [[/bip-0141.mediawiki|141]], [[/bip-0143.mediawiki|143]]
36+
| [[/bip-0141.mediawiki|141]], [[/bip-0143.mediawiki|143]], [[/bip-0147.mediawiki|147]]
3737
|}

bip-0023.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This BIP describes extensions to the getblocktemplate JSON-RPC call to enhance p
1313

1414
==Specification==
1515

16-
Note that all sections of this specification are optional extensions on top of [[BIP 0022|BIP 22]].
16+
Note that all sections of this specification are optional extensions on top of [[bip-0022.mediawiki|BIP 22]].
1717

1818
===Summary Support Levels===
1919

bip-0039.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ sentences (also known as brainwallets) into a wallet seed.
3333

3434
The mnemonic must encode entropy in a multiple of 32 bits. With more entropy
3535
security is improved but the sentence length increases. We refer to the
36-
initial entropy length as ENT. The recommended size of ENT is 128-256 bits.
36+
initial entropy length as ENT. The allowed size of ENT is 128-256 bits.
3737

3838
First, an initial entropy of ENT bits is generated. A checksum is generated by
3939
taking the first <pre>ENT / 32</pre> bits of its SHA256 hash. This checksum is

bip-0044.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ is required and a pull request to the above file should be created.
267267
* [[https://play.google.com/store/apps/details?id=com.mycelium.wallet|Mycelium Bitcoin Wallet (Android)]] ([[https://github.com/mycelium-com/wallet|source]])
268268
* [[https://copay.io/|Copay]] ([[https://github.com/bitpay/copay|source]])
269269
* [[https://maza.club/encompass|Encompass]] ([[https://github.com/mazaclub/encompass|source]])
270-
* [[https://www.coinvault.io/|CoinVault]]
270+
* [[https://www.coinvault.io/|CoinVault]] ([[https://github.com/CoinVault/dotblock|source]])
271271
==Reference==
272272

273273
* [[bip-0032.mediawiki|BIP32 - Hierarchical Deterministic Wallets]]

bip-0049.mediawiki

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<pre>
2+
BIP: 49
3+
Title: Derivation scheme for P2WPKH-nested-in-P2SH based accounts
4+
Author: Daniel Weigl <[email protected]>
5+
Status: Draft
6+
Type: Informational
7+
Created: 2016-05-19
8+
</pre>
9+
10+
==Abstract==
11+
12+
This BIP defines the derivation scheme for HD wallets using the P2WPKH-nested-in-P2SH ([[bip-0141.mediawiki|BIP 141]]) serialization format for segregated witness transactions.
13+
14+
==Motivation==
15+
16+
With the usage of P2WPKH-nested-in-P2SH ([[bip-0141.mediawiki#p2wpkh-nested-in-bip16-p2sh|BIP 141]]) transactions it is necessary to have a common derivation scheme.
17+
It allows the user to use different HD wallets with the same masterseed and/or a single account seamlessly.
18+
19+
Thus the user needs to create a dedicated segregate witness accounts, which ensures that only wallets compatible with this BIP
20+
will detect the account and handle them appropriately.
21+
22+
===Considerations===
23+
Two generally different approaches are possible for current BIP44 capable wallets:
24+
25+
1) Allow the user to use the same account(s) that they already uses, but add segregated witness encoded addresses to it
26+
27+
1.1) Use the same public keys as defined in BIP44, but in addition to the normal P2PKH address also derive the P2SH address from it.
28+
29+
1.2) Use the same account root, but branch off and derive different external and internal chain roots to derive dedicated public keys for the segregated witness addresses.
30+
31+
2) Create dedicated accounts only used for segregated witness addresses.
32+
33+
The solutions from point 1 have a common disadvantage: if a user imports/recovers a BIP49-compatible wallet masterseed into/in a non-BIP49-compatible wallet, the account might show up but also it might miss some UTXOs.
34+
35+
Therefore this BIP uses solution 2, which fails in a more visible way. Either the account shows up or not at all. The user does not have to check his balance after using the same seed in different wallets.
36+
37+
38+
==Specifications==
39+
40+
This BIP defines the two needed steps to derive multiple deterministic addresses based on a [[bip-0032.mediawiki|BIP 32]] root account.
41+
42+
===Public key derivation===
43+
44+
To derive a public key from the root account, this BIP uses the same account-structure as defined in
45+
[[bip-0044.mediawiki|BIP 44]], but only uses a different purpose value to indicate the different transaction
46+
serialization method.
47+
48+
<pre>
49+
m / purpose' / coin_type' / account' / change / address_index
50+
</pre>
51+
52+
For the `purpose`-path level it uses `49'`. The rest of the levels are used as defined in BIP44
53+
54+
55+
===Address derivation===
56+
57+
To derive the P2SH address from the above calculated public key, we use the encapsulation defined in [[bip-0141.mediawiki#p2wpkh-nested-in-bip16-p2sh|BIP 141]]:
58+
59+
witness: <signature> <pubkey>
60+
scriptSig: <0 <20-byte-key-hash>>
61+
(0x160014{20-byte-key-hash})
62+
scriptPubKey: HASH160 <20-byte-script-hash> EQUAL
63+
(0xA914{20-byte-script-hash}87)
64+
65+
==Backwards Compatibility==
66+
67+
This BIP is not backwards compatible by design as described under [#considerations]. A not compatible wallet will not discover accounts at all and the user will notice that something is wrong.
68+
69+
70+
==Test vectors==
71+
72+
<pre>
73+
masterseedWords = abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about
74+
masterseed = tprv8ZgxMBicQKsPe5YMU9gHen4Ez3ApihUfykaqUorj9t6FDqy3nP6eoXiAo2ssvpAjoLroQxHqr3R5nE3a5dU3DHTjTgJDd7zrbniJr6nrCzd (testnet)
75+
76+
// Account 0, root = m/49'/1'/0'
77+
account0Xpriv = tprv8gRrNu65W2Msef2BdBSUgFdRTGzC8EwVXnV7UGS3faeXtuMVtGfEdidVeGbThs4ELEoayCAzZQ4uUji9DUiAs7erdVskqju7hrBcDvDsdbY (testnet)
78+
79+
// Account 0, first receiving private key = m/49'/1'/0'/0/0
80+
account0recvPrivateKey = cULrpoZGXiuC19Uhvykx7NugygA3k86b3hmdCeyvHYQZSxojGyXJ
81+
account0recvPrivateKeyHex = 0xc9bdb49cfbaedca21c4b1f3a7803c34636b1d7dc55a717132443fc3f4c5867e8
82+
account0recvPublickKeyHex = 0x03a1af804ac108a8a51782198c2d034b28bf90c8803f5a53f76276fa69a4eae77f
83+
84+
// Address derivation
85+
keyhash = HASH160(account0recvPublickKeyHex) = 0x38971f73930f6c141d977ac4fd4a727c854935b3
86+
scriptSig = <0 <keyhash>> = 0x001438971f73930f6c141d977ac4fd4a727c854935b3
87+
addressBytes = HASH160(scriptSig) = 0x336caa13e08b96080a32b5d818d59b4ab3b36742
88+
89+
// addressBytes base58check encoded for testnet
90+
address = base58check(prefix | addressBytes) = 2Mww8dCYPUpKHofjgcXcBCEGmniw9CoaiD2 (testnet)
91+
</pre>
92+
93+
94+
==Reference==
95+
96+
* [[bip-0016.mediawiki|BIP16 - Pay to Script Hash]]
97+
* [[bip-0032.mediawiki|BIP32 - Hierarchical Deterministic Wallets]]
98+
* [[bip-0043.mediawiki|BIP43 - Purpose Field for Deterministic Wallets]]
99+
* [[bip-0044.mediawiki|BIP44 - Multi-Account Hierarchy for Deterministic Wallets]]
100+
* [[bip-0141.mediawiki|BIP141 - Segregated Witness (Consensus layer)]]
101+
102+
== Copyright ==
103+
104+
This document is placed in the public domain.

bip-0112.mediawiki

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ established in the following way. Alice, Bob and Escrow create a 2-of-3
5959
address with the following redeemscript.
6060

6161
IF
62-
2 <Alice's pubkey> <Bob's pubkey> <Escrow's pubkey> 3 CHECKMULTISIGVERIFY
62+
2 <Alice's pubkey> <Bob's pubkey> <Escrow's pubkey> 3 CHECKMULTISIG
6363
ELSE
6464
"30d" CHECKSEQUENCEVERIFY DROP
65-
<Alice's pubkey> CHECKSIGVERIFY
65+
<Alice's pubkey> CHECKSIG
6666
ENDIF
6767
6868
At any time funds can be spent using signatures from any two of Alice,

0 commit comments

Comments
 (0)