From b1e7db53760d8b4c4a976876f99f7fac1bebf4e9 Mon Sep 17 00:00:00 2001 From: Daniel Weigl Date: Tue, 14 Jun 2016 14:49:09 +0200 Subject: new bip proposal "Derivation scheme for P2WPKH-nested-in-P2SH based accounts" --- bip-p2sh-accounts.mediawiki | 95 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 bip-p2sh-accounts.mediawiki diff --git a/bip-p2sh-accounts.mediawiki b/bip-p2sh-accounts.mediawiki new file mode 100644 index 0000000..f7453c2 --- /dev/null +++ b/bip-p2sh-accounts.mediawiki @@ -0,0 +1,95 @@ +
+  BIP: 
+  Title: Derivation scheme for P2WPKH-nested-in-P2SH based accounts
+  Author: Daniel Weigl 
+  Status: Draft
+  Type: Informational
+  Created: 2016-05-19
+
+ +==Abstract== + +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. + +==Motivation== + +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. +It allows the user to use different HD wallets with the same masterseed and/or a single account seamlessly. + +Thus the user needs to create a dedicated segregate witness accounts, which ensures that only wallets compatible with this BIP +will detect the account and handle them appropriately. + +===Considerations=== +Two generally different approaches are possible for current BIP44 capable wallets: + + 1) Allow the user to use the same account(s) that they already uses, but add segregated witness encoded addresses to it + 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. + 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. + + 2) Create dedicated accounts only used for segregated witness addresses. + +The solutions from point 1 have a common disadvantage: if a user imports/recovers a BIP-compatible wallet masterseed into/in a non-BIP-compatible wallet, the account might show up but also it might miss some UTXOs. +Thus 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. + + +==Specifications== + +This BIP defines the two needed steps to derive multiple deterministic addresses based on a [[bip-0032.mediawiki|BIP 32]] +root account. + +===Public key derivation=== + +To derive a public key from the root account, this BIP uses the same account-structure as defined in +[[bip-0044.mediawiki|BIP 44]], but only uses a different purpose value to indicate the different transaction +serialization method. + +
+m / purpose' / coin_type' / account' / change / address_index
+
+ +For the `purpose`-path level it uses '. The rest of the levels are used as defined in BIP44 + + +===Address derivation=== + +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]]: + + witness: + scriptSig: <0 <20-byte-key-hash>> + (0x160014{20-byte-key-hash}) + scriptPubKey: HASH160 <20-byte-script-hash> EQUAL + (0xA914{20-byte-script-hash}87) + + +==Test vectors== + +(tbd. when we have the actual bip number) +
+  masterseedWords = abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about
+  masterseed = 
+
+  // Account 0, root = m/'/0'/0'
+  account0Xpriv = 
+
+  // Account 0, first receiving private key = m/'/0'/0'/0/0
+  account0recvPrivateKey = 
+  account0recvPublickKey = 
+
+  // Address derivation
+  keyhash = HASH160(account0recvPublickKey) = 
+  scriptSig = <0 > = 
+  addressBytes = HASH160(scriptSig) = 
+
+  // addressBytes base58check encoded for testnet
+  address = base58check(prefix | addressBytes) = 1xyz....
+
+ +... + +==Reference== + +* [[bip-0016.mediawiki|BIP16 - Pay to Script Hash]] +* [[bip-0032.mediawiki|BIP32 - Hierarchical Deterministic Wallets]] +* [[bip-0043.mediawiki|BIP43 - Purpose Field for Deterministic Wallets]] +* [[bip-0043.mediawiki|BIP44 - Multi-Account Hierarchy for Deterministic Wallets]] +* [[bip-0141.mediawiki|BIP141 - Segregated Witness (Consensus layer)]] \ No newline at end of file -- cgit v1.2.3 From babd604cc4fc040ec22d58f120569556afeac3ce Mon Sep 17 00:00:00 2001 From: Daniel Weigl Date: Tue, 14 Jun 2016 14:54:41 +0200 Subject: minor cleanups --- bip-p2sh-accounts.mediawiki | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/bip-p2sh-accounts.mediawiki b/bip-p2sh-accounts.mediawiki index f7453c2..cf03003 100644 --- a/bip-p2sh-accounts.mediawiki +++ b/bip-p2sh-accounts.mediawiki @@ -22,20 +22,22 @@ will detect the account and handle them appropriately. ===Considerations=== Two generally different approaches are possible for current BIP44 capable wallets: - 1) Allow the user to use the same account(s) that they already uses, but add segregated witness encoded addresses to it - 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. - 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. +1) Allow the user to use the same account(s) that they already uses, but add segregated witness encoded addresses to it - 2) Create dedicated accounts only used for segregated witness addresses. +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. -The solutions from point 1 have a common disadvantage: if a user imports/recovers a BIP-compatible wallet masterseed into/in a non-BIP-compatible wallet, the account might show up but also it might miss some UTXOs. -Thus 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. +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. + +2) Create dedicated accounts only used for segregated witness addresses. + +The solutions from point 1 have a common disadvantage: if a user imports/recovers a BIP-compatible wallet masterseed into/in a non-BIP{ThisBipNumber}-compatible wallet, the account might show up but also it might miss some UTXOs. + +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. ==Specifications== -This BIP defines the two needed steps to derive multiple deterministic addresses based on a [[bip-0032.mediawiki|BIP 32]] -root account. +This BIP defines the two needed steps to derive multiple deterministic addresses based on a [[bip-0032.mediawiki|BIP 32]] root account. ===Public key derivation=== @@ -47,7 +49,7 @@ serialization method. m / purpose' / coin_type' / account' / change / address_index -For the `purpose`-path level it uses '. The rest of the levels are used as defined in BIP44 +For the `purpose`-path level it uses {ThisBipNumber}'. The rest of the levels are used as defined in BIP44 ===Address derivation=== @@ -84,7 +86,6 @@ To derive the P2SH address from the above calculated public key, we use the enca address = base58check(prefix | addressBytes) = 1xyz.... -... ==Reference== -- cgit v1.2.3 From 2692800cab4680c3310fc900e2a3e6f479056e70 Mon Sep 17 00:00:00 2001 From: Thomas Kerin Date: Wed, 7 Sep 2016 16:25:59 +0100 Subject: Fix url for BIP44 --- bip-p2sh-accounts.mediawiki | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bip-p2sh-accounts.mediawiki b/bip-p2sh-accounts.mediawiki index cf03003..251f768 100644 --- a/bip-p2sh-accounts.mediawiki +++ b/bip-p2sh-accounts.mediawiki @@ -92,5 +92,5 @@ To derive the P2SH address from the above calculated public key, we use the enca * [[bip-0016.mediawiki|BIP16 - Pay to Script Hash]] * [[bip-0032.mediawiki|BIP32 - Hierarchical Deterministic Wallets]] * [[bip-0043.mediawiki|BIP43 - Purpose Field for Deterministic Wallets]] -* [[bip-0043.mediawiki|BIP44 - Multi-Account Hierarchy for Deterministic Wallets]] -* [[bip-0141.mediawiki|BIP141 - Segregated Witness (Consensus layer)]] \ No newline at end of file +* [[bip-0044.mediawiki|BIP44 - Multi-Account Hierarchy for Deterministic Wallets]] +* [[bip-0141.mediawiki|BIP141 - Segregated Witness (Consensus layer)]] -- cgit v1.2.3 From 544941d09600d14dc7daf0828d60b29248d337bc Mon Sep 17 00:00:00 2001 From: Daniel Weigl Date: Wed, 5 Oct 2016 13:22:18 +0200 Subject: added backwards compatibility and copyright --- bip-p2sh-accounts.mediawiki | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bip-p2sh-accounts.mediawiki b/bip-p2sh-accounts.mediawiki index 251f768..6011927 100644 --- a/bip-p2sh-accounts.mediawiki +++ b/bip-p2sh-accounts.mediawiki @@ -62,6 +62,10 @@ To derive the P2SH address from the above calculated public key, we use the enca scriptPubKey: HASH160 <20-byte-script-hash> EQUAL (0xA914{20-byte-script-hash}87) +==Backwards Compatibility== + +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. + ==Test vectors== @@ -94,3 +98,7 @@ To derive the P2SH address from the above calculated public key, we use the enca * [[bip-0043.mediawiki|BIP43 - Purpose Field for Deterministic Wallets]] * [[bip-0044.mediawiki|BIP44 - Multi-Account Hierarchy for Deterministic Wallets]] * [[bip-0141.mediawiki|BIP141 - Segregated Witness (Consensus layer)]] + +== Copyright == + +This document is placed in the public domain. \ No newline at end of file -- cgit v1.2.3 From 0f0dad6b89925d8cc5d8bd4ebf06da0fea9c8081 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 5 Oct 2016 11:35:37 +0000 Subject: Assign BIP 49: Derivation scheme for P2WPKH-nested-in-P2SH based accounts --- README.mediawiki | 6 +++ bip-0049.mediawiki | 104 ++++++++++++++++++++++++++++++++++++++++++++ bip-p2sh-accounts.mediawiki | 104 -------------------------------------------- 3 files changed, 110 insertions(+), 104 deletions(-) create mode 100644 bip-0049.mediawiki delete mode 100644 bip-p2sh-accounts.mediawiki diff --git a/README.mediawiki b/README.mediawiki index 974870e..1ac6b19 100644 --- a/README.mediawiki +++ b/README.mediawiki @@ -216,6 +216,12 @@ Those proposing changes should consider that ultimately consent may rest with th | Justus Ranvier | Informational | Draft +|- +| [[bip-0049.mediawiki|49]] +| Derivation scheme for P2WPKH-nested-in-P2SH based accounts +| Daniel Weigl +| Informational +| Draft |- style="background-color: #cfffcf" | [[bip-0050.mediawiki|50]] | March 2013 Chain Fork Post-Mortem diff --git a/bip-0049.mediawiki b/bip-0049.mediawiki new file mode 100644 index 0000000..5ec371f --- /dev/null +++ b/bip-0049.mediawiki @@ -0,0 +1,104 @@ +
+  BIP: 49
+  Title: Derivation scheme for P2WPKH-nested-in-P2SH based accounts
+  Author: Daniel Weigl 
+  Status: Draft
+  Type: Informational
+  Created: 2016-05-19
+
+ +==Abstract== + +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. + +==Motivation== + +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. +It allows the user to use different HD wallets with the same masterseed and/or a single account seamlessly. + +Thus the user needs to create a dedicated segregate witness accounts, which ensures that only wallets compatible with this BIP +will detect the account and handle them appropriately. + +===Considerations=== +Two generally different approaches are possible for current BIP44 capable wallets: + +1) Allow the user to use the same account(s) that they already uses, but add segregated witness encoded addresses to it + +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. + +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. + +2) Create dedicated accounts only used for segregated witness addresses. + +The solutions from point 1 have a common disadvantage: if a user imports/recovers a BIP49-compatible wallet masterseed into/in a non-BIP{ThisBipNumber}-compatible wallet, the account might show up but also it might miss some UTXOs. + +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. + + +==Specifications== + +This BIP defines the two needed steps to derive multiple deterministic addresses based on a [[bip-0032.mediawiki|BIP 32]] root account. + +===Public key derivation=== + +To derive a public key from the root account, this BIP uses the same account-structure as defined in +[[bip-0044.mediawiki|BIP 44]], but only uses a different purpose value to indicate the different transaction +serialization method. + +
+m / purpose' / coin_type' / account' / change / address_index
+
+ +For the `purpose`-path level it uses {ThisBipNumber}'. The rest of the levels are used as defined in BIP44 + + +===Address derivation=== + +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]]: + + witness: + scriptSig: <0 <20-byte-key-hash>> + (0x160014{20-byte-key-hash}) + scriptPubKey: HASH160 <20-byte-script-hash> EQUAL + (0xA914{20-byte-script-hash}87) + +==Backwards Compatibility== + +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. + + +==Test vectors== + +(tbd. when we have the actual bip number) +
+  masterseedWords = abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about
+  masterseed = 
+
+  // Account 0, root = m/49'/0'/0'
+  account0Xpriv = 
+
+  // Account 0, first receiving private key = m/49'/0'/0'/0/0
+  account0recvPrivateKey = 
+  account0recvPublickKey = 
+
+  // Address derivation
+  keyhash = HASH160(account0recvPublickKey) = 
+  scriptSig = <0 > = 
+  addressBytes = HASH160(scriptSig) = 
+
+  // addressBytes base58check encoded for testnet
+  address = base58check(prefix | addressBytes) = 1xyz....
+
+ + +==Reference== + +* [[bip-0016.mediawiki|BIP16 - Pay to Script Hash]] +* [[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-0141.mediawiki|BIP141 - Segregated Witness (Consensus layer)]] + +== Copyright == + +This document is placed in the public domain. diff --git a/bip-p2sh-accounts.mediawiki b/bip-p2sh-accounts.mediawiki deleted file mode 100644 index 6011927..0000000 --- a/bip-p2sh-accounts.mediawiki +++ /dev/null @@ -1,104 +0,0 @@ -
-  BIP: 
-  Title: Derivation scheme for P2WPKH-nested-in-P2SH based accounts
-  Author: Daniel Weigl 
-  Status: Draft
-  Type: Informational
-  Created: 2016-05-19
-
- -==Abstract== - -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. - -==Motivation== - -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. -It allows the user to use different HD wallets with the same masterseed and/or a single account seamlessly. - -Thus the user needs to create a dedicated segregate witness accounts, which ensures that only wallets compatible with this BIP -will detect the account and handle them appropriately. - -===Considerations=== -Two generally different approaches are possible for current BIP44 capable wallets: - -1) Allow the user to use the same account(s) that they already uses, but add segregated witness encoded addresses to it - -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. - -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. - -2) Create dedicated accounts only used for segregated witness addresses. - -The solutions from point 1 have a common disadvantage: if a user imports/recovers a BIP-compatible wallet masterseed into/in a non-BIP{ThisBipNumber}-compatible wallet, the account might show up but also it might miss some UTXOs. - -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. - - -==Specifications== - -This BIP defines the two needed steps to derive multiple deterministic addresses based on a [[bip-0032.mediawiki|BIP 32]] root account. - -===Public key derivation=== - -To derive a public key from the root account, this BIP uses the same account-structure as defined in -[[bip-0044.mediawiki|BIP 44]], but only uses a different purpose value to indicate the different transaction -serialization method. - -
-m / purpose' / coin_type' / account' / change / address_index
-
- -For the `purpose`-path level it uses {ThisBipNumber}'. The rest of the levels are used as defined in BIP44 - - -===Address derivation=== - -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]]: - - witness: - scriptSig: <0 <20-byte-key-hash>> - (0x160014{20-byte-key-hash}) - scriptPubKey: HASH160 <20-byte-script-hash> EQUAL - (0xA914{20-byte-script-hash}87) - -==Backwards Compatibility== - -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. - - -==Test vectors== - -(tbd. when we have the actual bip number) -
-  masterseedWords = abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about
-  masterseed = 
-
-  // Account 0, root = m/'/0'/0'
-  account0Xpriv = 
-
-  // Account 0, first receiving private key = m/'/0'/0'/0/0
-  account0recvPrivateKey = 
-  account0recvPublickKey = 
-
-  // Address derivation
-  keyhash = HASH160(account0recvPublickKey) = 
-  scriptSig = <0 > = 
-  addressBytes = HASH160(scriptSig) = 
-
-  // addressBytes base58check encoded for testnet
-  address = base58check(prefix | addressBytes) = 1xyz....
-
- - -==Reference== - -* [[bip-0016.mediawiki|BIP16 - Pay to Script Hash]] -* [[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-0141.mediawiki|BIP141 - Segregated Witness (Consensus layer)]] - -== Copyright == - -This document is placed in the public domain. \ No newline at end of file -- cgit v1.2.3