From e6b9822142eb41771dbaaa4dfd39d99432e92d49 Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Wed, 16 Dec 2020 19:22:20 +0800 Subject: [PATCH 01/23] Create bip-0048.mediawiki --- bip-0048.mediawiki | 253 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 bip-0048.mediawiki diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki new file mode 100644 index 00000000..7c398239 --- /dev/null +++ b/bip-0048.mediawiki @@ -0,0 +1,253 @@ +
+  BIP: 48
+  Layer: Applications
+  Title: Multi-Account/Multi-Script Hierarchy for Deterministic Multi Signature Wallets
+  Author: Peter Denton 
+  Comments-Summary: Mixed review (one person)
+  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0048
+  Status: Proposed
+  Type: Standards Track
+  Created: 2020-12-16
+
+ +==Abstract== + +This BIP defines a logical hierarchy for deterministic multi-sig wallets based on an algorithm +described in BIP-0067 (BIP67 from now on), BIP-0032 (BIP32 from now on) and purpose scheme described in +BIP-0043 (BIP43 from now on). + +This BIP is a particular application of BIP43. + +==Motivation== + +The hierarchy proposed in this paper is quite comprehensive. It allows the handling of +multiple accounts, external and internal chains per account, multiple script types and +millions of addresses per chain. + +==Key sorting== + +Any wallet that supports BIP48 inherently supports deterministic key sorting as per BIP67 so that all possible +multi-signature addresses/scripts are derived from deterministically ordered public keys. + +==Path levels== + +We define the following 6 levels in BIP32 path: + +
+m / purpose' / coin_type' / account' / script_type' / change / address_index
+
+ +`h` in the path indicates that BIP32 hardened derivation is used. + +Each level has a special meaning, described in the chapters below. + +===Purpose=== + +Purpose is a constant set to 48' following the BIP43 recommendation. +It indicates that the subtree of this node is used according to this specification. + +Hardened derivation is used at this level. + +===Coin type=== + +One master node (seed) can be used for either multiple Bitcoin networks. +Sharing the same space for various networks has some disadvantages. + +Avoiding reusing addresses across networks and improving privacy issues. + +Coin type `0` for mainnet and `1` for testnet. + +Hardened derivation is used at this level. + +===Account=== + +This level splits the key space into independent user identities, +so the wallet never mixes the coins across different accounts. + +Users can use these accounts to organize the funds in the same +fashion as bank accounts; for donation purposes (where all +addresses are considered public), for saving purposes, +for common expenses etc. + +Accounts are numbered from index 0 in sequentially increasing manner. +This number is used as child index in BIP32 derivation. + +Hardened derivation is used at this level. + +Software should prevent a creation of an account if a previous account does not +have a transaction history (meaning none of its addresses have been used before). + +Software needs to discover all used accounts after importing the seed from +an external source. Such an algorithm is described in "Account discovery" chapter. + +===Script=== + +This level splits the key space into three separate `script_type`(s). To provide +optimum backward compatibility. + +The recommended default is pay to witness script hash `m/48'/0'/0'/2'`. + +The following represent mainnet, account 0. + +`1'`: Nested Segwit (p2sh-p2wsh) `m/48'/0'/0'/1'`
+`2'`: Native Segwit (p2wsh) `m/48'/0'/0'/2'`
+`3'`: Legacy (p2sh) `m/48'/0'/0'/3'`
+ +===Change=== + +Constant 0 is used for external chain and constant 1 for internal chain (also +known as change addresses). External chain is used for addresses that are meant +to be visible outside of the wallet (e.g. for receiving payments). Internal +chain is used for addresses which are not meant to be visible outside of the +wallet and is used for return transaction change. + +Public derivation is used at this level. + +===Index=== + +Addresses are numbered from index 0 in sequentially increasing manner. +This number is used as child index in BIP32 derivation. + +Public derivation is used at this level. + +==Account discovery== + +When the master seed is imported from an external source the software should +start to discover the accounts in the following manner: + +* derive the first accounts node (index = 0) +* derive the external chain node of this account +* scan addresses of the external chain; respect the gap limit described below +* if no transactions are found on the external chain, stop discovery +* if there are some transactions, increase the account index and go to step 1 + +This algorithm is successful because software should disallow creation of new +accounts if previous one has no transaction history, as described in chapter +"Account" above. + +Please note that the algorithm works with the transaction history, not account +balances, so you can have an account with 0 total coins and the algorithm will +still continue with discovery. + +===Address gap limit=== + +Address gap limit is currently set to 20. If the software hits 20 unused +addresses in a row, it expects there are no used addresses beyond this point +and stops searching the address chain. We scan just the external chains, because +internal chains receive only coins that come from the associated external chains. + +Wallet software should warn when the user is trying to exceed the gap limit on +an external chain by generating a new address. + +==Examples== + +{| +!coin +!account +!script +!chain +!address +!path +|- +|Bitcoin +|first +|external +|first +|m / 48' / 0' / 0' / 2' / 0 / 0 +|- +|Bitcoin +|first +|external +|second +|m / 48' / 0' / 0' / 2' / 0 / 1 +|- +|Bitcoin +|first +|change +|first +|m / 48' / 0' / 0' / 2' / 1 / 0 +|- +|Bitcoin +|first +|change +|second +|m / 48' / 0' / 0' / 2' / 1 / 1 +|- +|Bitcoin +|second +|external +|first +|m / 48' / 0' / 1' / 2' / 0 / 0 +|- +|Bitcoin +|second +|external +|second +|m / 48' / 0' / 1' / 2' / 0 / 1 +|- +|Bitcoin +|second +|change +|first +|m / 48' / 0' / 1' / 2' / 1 / 0 +|- +|Bitcoin +|second +|change +|second +|m / 48' / 1' / 1' / 2' / 1 / 1 +|- +|Bitcoin Testnet +|first +|external +|first +|m / 48' / 1' / 0' / 2' / 0 / 0 +|- +|Bitcoin Testnet +|first +|external +|second +|m / 48' / 1' / 0' / 2' / 0 / 1 +|- +|Bitcoin Testnet +|first +|change +|first +|m / 48' / 1' / 0' / 2' / 1 / 0 +|- +|Bitcoin Testnet +|first +|change +|second +|m / 48' / 1' / 0' / 2' / 1 / 1 +|- +|Bitcoin Testnet +|second +|external +|first +|m / 48' / 1' / 1' / 2' / 0 / 0 +|- +|Bitcoin Testnet +|second +|external +|second +|m / 48' / 1' / 1' / 2' / 0 / 1 +|- +|Bitcoin Testnet +|second +|change +|first +|m / 48' / 1' / 1' / 2' / 1 / 0 +|- +|Bitcoin Testnet +|second +|change +|second +|m / 48 h / 1' / 1' / 2' / 1 / 1 +|} + +==Reference== + +* [[bip-0067.mediawiki|BIP67 - Deterministic Pay-to-script-hash multi-signature addresses through public key sorting]] +* [[bip-0032.mediawiki|BIP32 - Hierarchical Deterministic Wallets]] +* [[bip-0043.mediawiki|BIP43 - Purpose Field for Deterministic Wallets]] From c9517ecf8708f9745cc9d608b7936dff6c541b57 Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Wed, 16 Dec 2020 22:05:54 +0800 Subject: [PATCH 02/23] fixes --- .DS_Store | Bin 0 -> 18436 bytes bip-0048.mediawiki | 90 +++++++++++++++++++++++++++------------------ 2 files changed, 55 insertions(+), 35 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6f80a1ec80f0b10f9fff8b6300c28c0adeff69b9 GIT binary patch literal 18436 zcmeHPJ&znk5Ush-JsSy&jEGGMfZN;q+H5gr2?9$9CnQMr*~qdu%ZM{r1W1<=6Olp& zA|mD|I3^+{CPE@R>eVbqRqaj93yfr$8Edw0XKP;fy!X1MyLZPT(p>-i-b7?BA|u^V zUVBLo>zlEb+q(a=;dAUu+o~REbpKKJH9cSCQ+Y$S_1}T)E=50o2UfI6*tPBQiX6*> z(Ec~&p?oa&^ynRVqOYIGgZEAz-90{ebgc1uu`BP3tUf)rO^=AI>ppTg6J=pHo+BTM zY(BX-=U=`KrMEtuyY~9Uxyx;y^%hRk zz`(!-1IQ0!-BHdLd+SqpYb_{(6;H{IyAOp<3%}NlxJ;er|LO&s+R4k&0>nt zw5RLwF~YT+FUqsFY)_Y_Jzbhb&6v1gYpixH$NEOMW^TpsGB7YOa0vr%=`la|wK*#{ zk970cWsE%nvJuO0LIiR|gRO79v0 zvg2ljF(ELZi^qs-8hf%6*ECE6A0Pds@%?qKK!XZnw;#has4xgmLW9xNX^^jdKVCcd z4)OWg2@f~QcZtDxSo=Z1$n8Fi?FQc=KDV3ne2GDNe)NswJGSFM7{5Y;3S-*u9n-*L zME-O=Gw}z$eSB^=;aAh3!XW$#&zJ2W{AZs3qtJlxg7t$6gYbfB(2a4(f{cXh7rz)1bm2`nhRPVG#Y?`bLF8^mEh2 zV`ML+`<-dvie_a=Nd-kL_J8fwm5S>U=mjMP(R)o7-;U_(S7=%BdOTh5`99NQlt6>^^->Ct9 z@kWh8*DDOdPo_bILHNlus4xgWnFbXGk@rjkkC8P3kN5Y8iLMV2{l@sNFo=Ew4K_Y%L6pk;d&?cRACwqmKPWNC zeo$hN{h+|0Ry?6gi9z_ubor%I7hUn>^3z6zLHGlGqr@QcB>G0ch<#%!m&`3feC!(< z-+%33p|KCu<>Ndyoe>e2GosQ@KEogWd7#J9M zF&Svqj&2=Y*K5Na?6M8d+KqL;tvfcvo#7AN^ly6#|M`P}SPR)^#}(x|1Uaq - Comments-Summary: Mixed review (one person) + Comments-Summary: No comments Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0048 Status: Proposed Type: Standards Track @@ -27,7 +27,7 @@ millions of addresses per chain. ==Key sorting== Any wallet that supports BIP48 inherently supports deterministic key sorting as per BIP67 so that all possible -multi-signature addresses/scripts are derived from deterministically ordered public keys. +multi-signature addresses/scripts are derived from deterministically sorted public keys. ==Path levels== @@ -37,7 +37,7 @@ We define the following 6 levels in BIP32 path: m / purpose' / coin_type' / account' / script_type' / change / address_index -`h` in the path indicates that BIP32 hardened derivation is used. +h or ' in the path indicates that BIP32 hardened derivation is used. Each level has a special meaning, described in the chapters below. @@ -55,7 +55,7 @@ Sharing the same space for various networks has some disadvantages. Avoiding reusing addresses across networks and improving privacy issues. -Coin type `0` for mainnet and `1` for testnet. +Coin type 0 for mainnet and 1 for testnet. Hardened derivation is used at this level. @@ -82,16 +82,18 @@ an external source. Such an algorithm is described in "Account discovery" chapte ===Script=== -This level splits the key space into three separate `script_type`(s). To provide +This level splits the key space into three separate script_type(s). To provide optimum backward compatibility. -The recommended default is pay to witness script hash `m/48'/0'/0'/2'`. +The recommended default is pay to witness script hash m/48'/0'/0'/2'. The following represent mainnet, account 0. -`1'`: Nested Segwit (p2sh-p2wsh) `m/48'/0'/0'/1'`
-`2'`: Native Segwit (p2wsh) `m/48'/0'/0'/2'`
-`3'`: Legacy (p2sh) `m/48'/0'/0'/3'`
+1': Nested Segwit (p2sh-p2wsh) m/48'/0'/0'/1'
+2': Native Segwit (p2wsh) m/48'/0'/0'/2'
+3': Legacy (p2sh) m/48'/0'/0'/3'
+ +Easily expanded to account for new script types. ===Change=== @@ -142,109 +144,127 @@ an external chain by generating a new address. ==Examples== {| -!coin -!account -!script -!chain -!address -!path +|network +|account +|script +|chain +|address +|path |- -|Bitcoin +|mainnet |first +|p2wsh |external |first |m / 48' / 0' / 0' / 2' / 0 / 0 |- -|Bitcoin +|mainnet |first +|p2wsh |external |second |m / 48' / 0' / 0' / 2' / 0 / 1 |- -|Bitcoin +|mainnet |first +|p2wsh |change |first |m / 48' / 0' / 0' / 2' / 1 / 0 |- -|Bitcoin +|mainnet |first +|p2wsh |change |second |m / 48' / 0' / 0' / 2' / 1 / 1 |- -|Bitcoin +|mainnet |second +|p2wsh |external |first |m / 48' / 0' / 1' / 2' / 0 / 0 |- -|Bitcoin +|mainnet |second +|p2wsh |external |second |m / 48' / 0' / 1' / 2' / 0 / 1 |- -|Bitcoin +|mainnet |second +|p2sh |change |first -|m / 48' / 0' / 1' / 2' / 1 / 0 +|m / 48' / 0' / 1' / 3' / 1 / 0 |- -|Bitcoin +|mainnet |second +|p2sh |change |second -|m / 48' / 1' / 1' / 2' / 1 / 1 +|m / 48' / 1' / 1' / 3' / 1 / 1 |- -|Bitcoin Testnet +|testnet |first +|p2sh-p2wsh |external |first -|m / 48' / 1' / 0' / 2' / 0 / 0 +|m / 48' / 1' / 0' / 1' / 0 / 0 |- -|Bitcoin Testnet +|testnet |first +|p2wsh |external |second |m / 48' / 1' / 0' / 2' / 0 / 1 |- -|Bitcoin Testnet +|testnet |first +|p2wsh |change |first |m / 48' / 1' / 0' / 2' / 1 / 0 |- -|Bitcoin Testnet +|testnet |first +|p2wsh |change |second |m / 48' / 1' / 0' / 2' / 1 / 1 |- -|Bitcoin Testnet +|testnet |second +|p2wsh |external |first |m / 48' / 1' / 1' / 2' / 0 / 0 |- -|Bitcoin Testnet +|testnet |second +|p2wsh |external |second |m / 48' / 1' / 1' / 2' / 0 / 1 |- -|Bitcoin Testnet +|testnet |second +|p2wsh |change |first |m / 48' / 1' / 1' / 2' / 1 / 0 |- -|Bitcoin Testnet +|testnet |second +|p2wsh |change |second |m / 48 h / 1' / 1' / 2' / 1 / 1 -|} +|- +}| + ==Reference== From 23d57cb9ad0378abaeeb3ddeecced87384498eca Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Wed, 16 Dec 2020 22:31:24 +0800 Subject: [PATCH 03/23] typo --- bip-0048.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 386b410e..470febf3 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -261,7 +261,7 @@ an external chain by generating a new address. |p2wsh |change |second -|m / 48 h / 1' / 1' / 2' / 1 / 1 +|m / 48' / 1' / 1' / 2' / 1 / 1 |- }| From 42b9148ceaa30f7c7a60b4e29ad07ffb47e31b05 Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Wed, 16 Dec 2020 22:35:09 +0800 Subject: [PATCH 04/23] minor --- bip-0048.mediawiki | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 470febf3..bfea5f0a 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -83,18 +83,16 @@ an external source. Such an algorithm is described in "Account discovery" chapte ===Script=== This level splits the key space into three separate script_type(s). To provide -optimum backward compatibility. +backward and forward compatibility. + +The following represent mainnet, account 0: The recommended default is pay to witness script hash m/48'/0'/0'/2'. -The following represent mainnet, account 0. - 1': Nested Segwit (p2sh-p2wsh) m/48'/0'/0'/1'
2': Native Segwit (p2wsh) m/48'/0'/0'/2'
3': Legacy (p2sh) m/48'/0'/0'/3'
-Easily expanded to account for new script types. - ===Change=== Constant 0 is used for external chain and constant 1 for internal chain (also From ff04f6cea417038c8a382c0b141faea2d1dd26fb Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Wed, 16 Dec 2020 22:36:43 +0800 Subject: [PATCH 05/23] Update bip-0048.mediawiki --- bip-0048.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index bfea5f0a..2b0df317 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -50,7 +50,7 @@ Hardened derivation is used at this level. ===Coin type=== -One master node (seed) can be used for either multiple Bitcoin networks. +One master node (seed) can be used for multiple Bitcoin networks. Sharing the same space for various networks has some disadvantages. Avoiding reusing addresses across networks and improving privacy issues. From bfebc4b047eac88c86a2cd98fcd37ee110be85b1 Mon Sep 17 00:00:00 2001 From: benk10 Date: Wed, 16 Dec 2020 16:43:21 +0200 Subject: [PATCH 06/23] Mention BIP 44 as the Multi-Account standard --- bip-0048.mediawiki | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 2b0df317..b164bea8 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -13,8 +13,9 @@ ==Abstract== This BIP defines a logical hierarchy for deterministic multi-sig wallets based on an algorithm -described in BIP-0067 (BIP67 from now on), BIP-0032 (BIP32 from now on) and purpose scheme described in -BIP-0043 (BIP43 from now on). +described in BIP-0067 (BIP67 from now on), BIP-0032 (BIP32 from now on), purpose scheme described in +BIP-0043 (BIP43 from now on), and multi-account hierarchy described in +BIP-0044 (BIP44 from now on). This BIP is a particular application of BIP43. @@ -61,7 +62,7 @@ Hardened derivation is used at this level. ===Account=== -This level splits the key space into independent user identities, +This level splits the key space into independent user identities, following the BIP44 pattern, so the wallet never mixes the coins across different accounts. Users can use these accounts to organize the funds in the same @@ -269,3 +270,4 @@ an external chain by generating a new address. * [[bip-0067.mediawiki|BIP67 - Deterministic Pay-to-script-hash multi-signature addresses through public key sorting]] * [[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]] From 4e81e16224d647c5268e21a2bb280f9678f5f91a Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Wed, 16 Dec 2020 22:54:41 +0800 Subject: [PATCH 07/23] Update bip-0048.mediawiki --- bip-0048.mediawiki | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 2b0df317..06d8471e 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -18,6 +18,9 @@ BIP-0043 (BIP43 from now on). This BIP is a particular application of BIP43. +Credit to Marek Palatinus and Pavol Rusnak who wrote BIP-0044 +which was used as the basis for this BIP. + ==Motivation== The hierarchy proposed in this paper is quite comprehensive. It allows the handling of From 9ec6bf64b715724ffcc607d156cd99429665d8bd Mon Sep 17 00:00:00 2001 From: benk10 Date: Wed, 16 Dec 2020 16:55:38 +0200 Subject: [PATCH 08/23] Fix the table --- bip-0048.mediawiki | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index b164bea8..a4dbbccb 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -261,8 +261,7 @@ an external chain by generating a new address. |change |second |m / 48' / 1' / 1' / 2' / 1 / 1 -|- -}| +|} ==Reference== From eae5288ffdca6866d93c3b6ca99e24afea82cd46 Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Wed, 16 Dec 2020 22:59:10 +0800 Subject: [PATCH 09/23] Update bip-0048.mediawiki --- bip-0048.mediawiki | 3 --- 1 file changed, 3 deletions(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 06d8471e..2b0df317 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -18,9 +18,6 @@ BIP-0043 (BIP43 from now on). This BIP is a particular application of BIP43. -Credit to Marek Palatinus and Pavol Rusnak who wrote BIP-0044 -which was used as the basis for this BIP. - ==Motivation== The hierarchy proposed in this paper is quite comprehensive. It allows the handling of From 38096cedd9863b9fe9f363f0e2127e73609b79b0 Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Wed, 16 Dec 2020 23:12:19 +0800 Subject: [PATCH 10/23] remove bip44 stuff --- bip-0048.mediawiki | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index a4dbbccb..26624043 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -111,35 +111,6 @@ This number is used as child index in BIP32 derivation. Public derivation is used at this level. -==Account discovery== - -When the master seed is imported from an external source the software should -start to discover the accounts in the following manner: - -* derive the first accounts node (index = 0) -* derive the external chain node of this account -* scan addresses of the external chain; respect the gap limit described below -* if no transactions are found on the external chain, stop discovery -* if there are some transactions, increase the account index and go to step 1 - -This algorithm is successful because software should disallow creation of new -accounts if previous one has no transaction history, as described in chapter -"Account" above. - -Please note that the algorithm works with the transaction history, not account -balances, so you can have an account with 0 total coins and the algorithm will -still continue with discovery. - -===Address gap limit=== - -Address gap limit is currently set to 20. If the software hits 20 unused -addresses in a row, it expects there are no used addresses beyond this point -and stops searching the address chain. We scan just the external chains, because -internal chains receive only coins that come from the associated external chains. - -Wallet software should warn when the user is trying to exceed the gap limit on -an external chain by generating a new address. - ==Examples== {| From 86e77903bac083f70f19a3356e28eb5174e8cab7 Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Wed, 24 Feb 2021 21:27:15 +0800 Subject: [PATCH 11/23] fix: remove legacy references --- bip-0048.mediawiki | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 26624043..245a066b 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -92,7 +92,6 @@ The recommended default is pay to witness script hash m/48'/0'/0'/2'1': Nested Segwit (p2sh-p2wsh) m/48'/0'/0'/1'
2': Native Segwit (p2wsh) m/48'/0'/0'/2'
-3': Legacy (p2sh) m/48'/0'/0'/3'
===Change=== @@ -163,20 +162,6 @@ Public derivation is used at this level. |second |m / 48' / 0' / 1' / 2' / 0 / 1 |- -|mainnet -|second -|p2sh -|change -|first -|m / 48' / 0' / 1' / 3' / 1 / 0 -|- -|mainnet -|second -|p2sh -|change -|second -|m / 48' / 1' / 1' / 3' / 1 / 1 -|- |testnet |first |p2sh-p2wsh From bf8c208da516143b75d62241279887e61b86e1bb Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Wed, 24 Feb 2021 21:36:10 +0800 Subject: [PATCH 12/23] fix: define motivation, remove account creation blurb. --- bip-0048.mediawiki | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 245a066b..4f8d5429 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -21,10 +21,16 @@ This BIP is a particular application of BIP43. ==Motivation== +The motivation of this BIP is to define the existing industry wide practice of utilizing m/48' +derivation paths in hierarchical deterministic multi-sig wallets so that other developers may +benefit from a standard. + The hierarchy proposed in this paper is quite comprehensive. It allows the handling of multiple accounts, external and internal chains per account, multiple script types and millions of addresses per chain. +This paper was inspired from BIP44. + ==Key sorting== Any wallet that supports BIP48 inherently supports deterministic key sorting as per BIP67 so that all possible @@ -75,21 +81,15 @@ This number is used as child index in BIP32 derivation. Hardened derivation is used at this level. -Software should prevent a creation of an account if a previous account does not -have a transaction history (meaning none of its addresses have been used before). - -Software needs to discover all used accounts after importing the seed from -an external source. Such an algorithm is described in "Account discovery" chapter. - ===Script=== -This level splits the key space into three separate script_type(s). To provide +This level splits the key space into two separate script_type(s). To provide backward and forward compatibility. -The following represent mainnet, account 0: - The recommended default is pay to witness script hash m/48'/0'/0'/2'. +The following represent mainnet, account 0: + 1': Nested Segwit (p2sh-p2wsh) m/48'/0'/0'/1'
2': Native Segwit (p2wsh) m/48'/0'/0'/2'
From 32d6ee217ab96845a1ead620cfe595c366d2bd79 Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Wed, 24 Feb 2021 21:38:46 +0800 Subject: [PATCH 13/23] fix: bip number not actually assigned --- bip-0048.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 4f8d5429..a266afd4 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -1,5 +1,5 @@
-  BIP: 48
+  BIP: Number not assigned
   Layer: Applications
   Title: Multi-Account/Multi-Script Hierarchy for Deterministic Multi Signature Wallets
   Author: Peter Denton 

From dd3033f0dd48f930d4eb3d7f2a8faba22d974855 Mon Sep 17 00:00:00 2001
From: Fonta1n3 
Date: Sat, 27 Feb 2021 11:29:31 +0800
Subject: [PATCH 14/23] fix: this is specific to an existing standard only

---
 bip-0048.mediawiki | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki
index a266afd4..a7384087 100644
--- a/bip-0048.mediawiki
+++ b/bip-0048.mediawiki
@@ -84,7 +84,7 @@ Hardened derivation is used at this level.
 ===Script===
 
 This level splits the key space into two separate script_type(s). To provide
-backward and forward compatibility.
+backward compatibility.
 
 The recommended default is pay to witness script hash m/48'/0'/0'/2'.
 

From 8a3a8bd04279537066a504de1211a7fb48087526 Mon Sep 17 00:00:00 2001
From: Fonta1n3 
Date: Sun, 28 Feb 2021 09:24:59 +0800
Subject: [PATCH 15/23] fix: update to provide for future extensibility

---
 bip-0048.mediawiki | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki
index a7384087..96c01afb 100644
--- a/bip-0048.mediawiki
+++ b/bip-0048.mediawiki
@@ -23,7 +23,8 @@ This BIP is a particular application of BIP43.
 
 The motivation of this BIP is to define the existing industry wide practice of utilizing  m/48'
 derivation paths in hierarchical deterministic multi-sig wallets so that other developers may
-benefit from a standard.
+benefit from a standard. This BIP allows for future script types to easily be appended to the
+specification so that a new BIP is not required for every future script type.
 
 The hierarchy proposed in this paper is quite comprehensive. It allows the handling of
 multiple accounts, external and internal chains per account, multiple script types and
@@ -84,15 +85,22 @@ Hardened derivation is used at this level.
 ===Script===
 
 This level splits the key space into two separate script_type(s). To provide
-backward compatibility.
+forward compatibility for future script types this specification can be easily extended.
 
-The recommended default is pay to witness script hash m/48'/0'/0'/2'.
-
-The following represent mainnet, account 0:
+Currently the only script types covered by this BIP are Native Segwit (p2wsh) and
+Nested Segwit (p2sh-p2wsh).
 
+The following path represents Nested Segwit (p2sh-p2wsh) mainnet, account 0:
 1': Nested Segwit (p2sh-p2wsh) m/48'/0'/0'/1'
+ +The following paths represent Native Segwit (p2wsh) mainnet, account 0: 2': Native Segwit (p2wsh) m/48'/0'/0'/2'
+The recommended default for wallets is pay to witness script hash m/48'/0'/0'/2'. + +To add new script types submit a PR to this specification and include it in the list above: +X': Future script type m/48'/0'/0'/X'
+ ===Change=== Constant 0 is used for external chain and constant 1 for internal chain (also From 0b667770d821ade047fdebe562e77eb974ed745f Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Sun, 28 Feb 2021 09:48:29 +0800 Subject: [PATCH 16/23] fix: typo --- bip-0048.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 96c01afb..68c01906 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -93,7 +93,7 @@ Nested Segwit (p2sh-p2wsh). The following path represents Nested Segwit (p2sh-p2wsh) mainnet, account 0: 1': Nested Segwit (p2sh-p2wsh) m/48'/0'/0'/1'
-The following paths represent Native Segwit (p2wsh) mainnet, account 0: +The following path represents Native Segwit (p2wsh) mainnet, account 0: 2': Native Segwit (p2wsh) m/48'/0'/0'/2'
The recommended default for wallets is pay to witness script hash m/48'/0'/0'/2'. From 1eb8a3ca4d8ab6d6aab2fd947ef9e613026df1f0 Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Tue, 20 Jul 2021 09:43:55 +0800 Subject: [PATCH 17/23] Update bip-0048.mediawiki - Replace BIP number with ? - Reduce title to less then 44 characters - Add MIT Licence and copyright section - Add specification section - Add backwards compatibility section --- bip-0048.mediawiki | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 68c01906..313bfcf5 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -1,13 +1,14 @@
-  BIP: Number not assigned
+  BIP: ?
   Layer: Applications
-  Title: Multi-Account/Multi-Script Hierarchy for Deterministic Multi Signature Wallets
+  Title: Multi-Script Hierarchy for Multi-Sig Wallets
   Author: Peter Denton 
   Comments-Summary: No comments
-  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0048
+  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-?
   Status: Proposed
   Type: Standards Track
   Created: 2020-12-16
+  License: MIT License
 
==Abstract== @@ -19,6 +20,9 @@ BIP-0044 (BIP44 from now on). This BIP is a particular application of BIP43. +==Copyright== +This BIP falls under the MIT License. + ==Motivation== The motivation of this BIP is to define the existing industry wide practice of utilizing m/48' @@ -32,12 +36,22 @@ millions of addresses per chain. This paper was inspired from BIP44. -==Key sorting== +==Backwards compatibility== + +Currently a number of wallets already utilize this derivation scheme for HD multi-sig accounts. +This BIP is intended to maintain the *existing* real world use of the `48'` derivation. +No breaking changes are made so as to avoid "loss of funds" to existing users. +Wallet's which currently support the `48'` derivation will not need to make any changes +to comply with this BIP. + +==Specification== + +===Key sorting=== Any wallet that supports BIP48 inherently supports deterministic key sorting as per BIP67 so that all possible multi-signature addresses/scripts are derived from deterministically sorted public keys. -==Path levels== +===Path levels=== We define the following 6 levels in BIP32 path: From c3c0abd44d79124e418f245de2d960ca123c46dc Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Tue, 20 Jul 2021 09:45:59 +0800 Subject: [PATCH 18/23] Update bip-0048.mediawiki --- bip-0048.mediawiki | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 313bfcf5..20f8b290 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -21,6 +21,7 @@ BIP-0044 (BIP44 from now on). This BIP is a particular application of BIP43. ==Copyright== + This BIP falls under the MIT License. ==Motivation== @@ -38,7 +39,7 @@ This paper was inspired from BIP44. ==Backwards compatibility== -Currently a number of wallets already utilize this derivation scheme for HD multi-sig accounts. +Currently a number of wallets utilize the `48'` derivation scheme for HD multi-sig accounts. This BIP is intended to maintain the *existing* real world use of the `48'` derivation. No breaking changes are made so as to avoid "loss of funds" to existing users. Wallet's which currently support the `48'` derivation will not need to make any changes From bc0593133273f62dbd0c7beeee7c875e14c438cd Mon Sep 17 00:00:00 2001 From: Fonta1n3 Date: Tue, 20 Jul 2021 09:58:04 +0800 Subject: [PATCH 19/23] Delete .DS_Store --- .DS_Store | Bin 18436 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 6f80a1ec80f0b10f9fff8b6300c28c0adeff69b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18436 zcmeHPJ&znk5Ush-JsSy&jEGGMfZN;q+H5gr2?9$9CnQMr*~qdu%ZM{r1W1<=6Olp& zA|mD|I3^+{CPE@R>eVbqRqaj93yfr$8Edw0XKP;fy!X1MyLZPT(p>-i-b7?BA|u^V zUVBLo>zlEb+q(a=;dAUu+o~REbpKKJH9cSCQ+Y$S_1}T)E=50o2UfI6*tPBQiX6*> z(Ec~&p?oa&^ynRVqOYIGgZEAz-90{ebgc1uu`BP3tUf)rO^=AI>ppTg6J=pHo+BTM zY(BX-=U=`KrMEtuyY~9Uxyx;y^%hRk zz`(!-1IQ0!-BHdLd+SqpYb_{(6;H{IyAOp<3%}NlxJ;er|LO&s+R4k&0>nt zw5RLwF~YT+FUqsFY)_Y_Jzbhb&6v1gYpixH$NEOMW^TpsGB7YOa0vr%=`la|wK*#{ zk970cWsE%nvJuO0LIiR|gRO79v0 zvg2ljF(ELZi^qs-8hf%6*ECE6A0Pds@%?qKK!XZnw;#has4xgmLW9xNX^^jdKVCcd z4)OWg2@f~QcZtDxSo=Z1$n8Fi?FQc=KDV3ne2GDNe)NswJGSFM7{5Y;3S-*u9n-*L zME-O=Gw}z$eSB^=;aAh3!XW$#&zJ2W{AZs3qtJlxg7t$6gYbfB(2a4(f{cXh7rz)1bm2`nhRPVG#Y?`bLF8^mEh2 zV`ML+`<-dvie_a=Nd-kL_J8fwm5S>U=mjMP(R)o7-;U_(S7=%BdOTh5`99NQlt6>^^->Ct9 z@kWh8*DDOdPo_bILHNlus4xgWnFbXGk@rjkkC8P3kN5Y8iLMV2{l@sNFo=Ew4K_Y%L6pk;d&?cRACwqmKPWNC zeo$hN{h+|0Ry?6gi9z_ubor%I7hUn>^3z6zLHGlGqr@QcB>G0ch<#%!m&`3feC!(< z-+%33p|KCu<>Ndyoe>e2GosQ@KEogWd7#J9M zF&Svqj&2=Y*K5Na?6M8d+KqL;tvfcvo#7AN^ly6#|M`P}SPR)^#}(x|1Uaq Date: Tue, 20 Jul 2021 10:00:59 +0800 Subject: [PATCH 20/23] Update bip-0048.mediawiki --- bip-0048.mediawiki | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 20f8b290..6004ad26 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -39,10 +39,10 @@ This paper was inspired from BIP44. ==Backwards compatibility== -Currently a number of wallets utilize the `48'` derivation scheme for HD multi-sig accounts. -This BIP is intended to maintain the *existing* real world use of the `48'` derivation. +Currently a number of wallets utilize the `m/48'` derivation scheme for HD multi-sig accounts. +This BIP is intended to maintain the *existing* real world use of the `m/48'` derivation. No breaking changes are made so as to avoid "loss of funds" to existing users. -Wallet's which currently support the `48'` derivation will not need to make any changes +Wallet's which currently support the `m/48'` derivation will not need to make any changes to comply with this BIP. ==Specification== From 90cb1c89065207c59847d6259db23f0507fd30c6 Mon Sep 17 00:00:00 2001 From: Fontan3 Date: Tue, 20 Jul 2021 12:23:59 +0800 Subject: [PATCH 21/23] Update bip-0048.mediawiki --- bip-0048.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index 6004ad26..c63e7367 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -2,7 +2,7 @@ BIP: ? Layer: Applications Title: Multi-Script Hierarchy for Multi-Sig Wallets - Author: Peter Denton + Author: Fontaine Comments-Summary: No comments Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-? Status: Proposed From 84e14b68a62d82ab330a847f63f871494df94962 Mon Sep 17 00:00:00 2001 From: Fontan3 Date: Tue, 20 Jul 2021 12:30:54 +0800 Subject: [PATCH 22/23] Update bip-0048.mediawiki Add code snippets. --- bip-0048.mediawiki | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index c63e7367..cba896a2 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -39,10 +39,10 @@ This paper was inspired from BIP44. ==Backwards compatibility== -Currently a number of wallets utilize the `m/48'` derivation scheme for HD multi-sig accounts. -This BIP is intended to maintain the *existing* real world use of the `m/48'` derivation. +Currently a number of wallets utilize the ‎m/48' derivation scheme for HD multi-sig accounts. +This BIP is intended to maintain the *existing* real world use of the ‎m/48' derivation. No breaking changes are made so as to avoid "loss of funds" to existing users. -Wallet's which currently support the `m/48'` derivation will not need to make any changes +Wallet's which currently support the ‎m/48' derivation will not need to make any changes to comply with this BIP. ==Specification== From 03f2d744d345500bb30b2d0e52d3ecfa69fdc21e Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Tue, 20 Jul 2021 19:31:25 +0000 Subject: [PATCH 23/23] Fix BIP 48 headers and add to README --- README.mediawiki | 7 +++++++ bip-0048.mediawiki | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.mediawiki b/README.mediawiki index 106c455d..252c006f 100644 --- a/README.mediawiki +++ b/README.mediawiki @@ -258,6 +258,13 @@ Those proposing changes should consider that ultimately consent may rest with th | Justus Ranvier | Informational | Draft +|- style="background-color: #ffffcf" +| [[bip-0048.mediawiki|48]] +| Applications +| Multi-Script Hierarchy for Multi-Sig Wallets +| Fontaine +| Standard +| Proposed |- style="background-color: #cfffcf" | [[bip-0049.mediawiki|49]] | Applications diff --git a/bip-0048.mediawiki b/bip-0048.mediawiki index cba896a2..0b099b3f 100644 --- a/bip-0048.mediawiki +++ b/bip-0048.mediawiki @@ -1,14 +1,14 @@
-  BIP: ?
+  BIP: 48
   Layer: Applications
   Title: Multi-Script Hierarchy for Multi-Sig Wallets
   Author: Fontaine 
   Comments-Summary: No comments
-  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-?
+  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0048
   Status: Proposed
   Type: Standards Track
   Created: 2020-12-16
-  License: MIT License
+  License: MIT
 
==Abstract==