Skip to content

Commit 7152934

Browse files
committed
Switch from Markdown-style code to Mediawiki
1 parent a2645cd commit 7152934

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

bip-0045.mediawiki

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
This BIP defines a structure for hierarchical deterministic P2SH multi-party
1818
multi-signature wallets (HDPM wallets from now on) based on the algorithm
19-
described in BIP-0032 (BIP32 from now on) and purpose scheme described in
19+
described in BIP-0032 (BIP32 from now on) and purpose scheme described in
2020
BIP-0043 (BIP43 from now on).
2121
This BIP is a particular application of BIP43.
2222

@@ -63,7 +63,7 @@ Hardened derivation is used at this level.
6363
The index of the party creating a P2SH multisig address. The indices can
6464
be determined independently by lexicographically sorting the purpose public
6565
keys of each cosigner. Each cosigner creates addresses on its own branch,
66-
even though they have independent extended master public key, as explained
66+
even though they have independent extended master public key, as explained
6767
in the "Address generation" section.
6868

6969
Note that the master public key is not shared amongst the cosigners. Only the
@@ -79,12 +79,12 @@ purpose public keys:
7979
03f76588e06c0d688617ef365d1e58a7f1aa84daa3801380b1e7f12acc9a69cd13
8080
</pre>
8181

82-
it should use `m / 45 ' / 0 / *` for
83-
`039863fb5f07b667d9b1ca68773c6e6cdbcac0088ffba9af46f6f6acd153d44463`,
84-
`m / 45 ' / 1 / *` for
85-
`03a473275a750a20b7b71ebeadfec83130c014da4b53f1c4743fcf342af6589a38`,
86-
and `m / 45 ' / 2 / *` for
87-
`03f76588e06c0d688617ef365d1e58a7f1aa84daa3801380b1e7f12acc9a69cd13`,
82+
it should use <code>m / 45 ' / 0 / *</code> for
83+
<code>039863fb5f07b667d9b1ca68773c6e6cdbcac0088ffba9af46f6f6acd153d44463</code>,
84+
<code>m / 45 ' / 1 / *</code> for
85+
<code>03a473275a750a20b7b71ebeadfec83130c014da4b53f1c4743fcf342af6589a38</code>,
86+
and <code>m / 45 ' / 2 / *</code> for
87+
<code>03f76588e06c0d688617ef365d1e58a7f1aa84daa3801380b1e7f12acc9a69cd13</code>,
8888
as dictated by their lexicographical order.
8989

9090

@@ -102,7 +102,7 @@ chain is used for addresses which are not meant to be visible outside of the
102102
wallet and is used for return transaction change.
103103

104104
For example, if cosigner 2 wants to generate a change address, he would use
105-
`m / 45 ' / 2 / 1 / *`, and `m / 45 ' / 2 / 0 / *` for a receive
105+
<code>m / 45 ' / 2 / 1 / *</code>, and <code>m / 45 ' / 2 / 0 / *</code> for a receive
106106
address.
107107

108108
Non-hardened derivation is used at this level.
@@ -118,7 +118,7 @@ Non-hardened derivation is used at this level.
118118
Each party generates their own extended master keypair and shares the
119119
extended purpose' public key with the others, which is stored encrypted.
120120
Each party can generate any of the other's derived public keys, but only
121-
his own private keys.
121+
his own private keys.
122122

123123
===Address Generation Procedure===
124124
When generating an address, each party can independently generate the N needed
@@ -137,18 +137,18 @@ others using the next index, and calculate the needed script for the address.
137137

138138
Example: Cosigner #2 wants to receive a payment to the shared wallet. His last
139139
used index on his own branch is 4. Then, the path for the next receive
140-
address is `m/45'/2/0/5`. He uses this same path in all of the cosigners
140+
address is <code>m/45'/2/0/5</code>. He uses this same path in all of the cosigners
141141
trees to generate a public key for each one, and from that he gets the new
142142
p2sh address.
143143
====Change address case====
144144
Again, each cosigner generates addresses only on his own branch. One of the
145145
n cosigners wants to create an outgoing payment, for which he'll need a change
146146
address. He generates a new address using the same procedure as above, but
147-
using a separate index to track the used change addresses.
147+
using a separate index to track the used change addresses.
148148

149149
Example: Cosigner #5 wants to send a payment from the shared wallet, for which
150150
he'll need a change address. His last used change index on his own branch is
151-
11. Then, the path for the next change address is `m/45'/5/1/12`. He uses
151+
11. Then, the path for the next change address is <code>m/45'/5/1/12</code>. He uses
152152
this same path in all of the cosigners trees to generate a public key for each
153153
one, and from that he gets the new p2sh address.
154154

@@ -163,16 +163,16 @@ that specific address (using the same path that generated the public key in
163163
that address, but deriving the private key instead), and sign it. Once the
164164
proposal reaches m signatures, any cosigner can broadcast it to the network,
165165
becoming final. The specifics of how this proposal is structured, and the
166-
protocol to accept or reject it, belong to another BIP, in my opinion.
166+
protocol to accept or reject it, belong to another BIP, in my opinion.
167167

168168
===Address discovery===
169169

170170
When the master seed is imported from an external source the software should
171171
start to discover the addresses in the following manner:
172172

173173
# for each cosigner:
174-
# derive the cosigner's node (`m / 45' / cosigner_index`)
175-
# for both the external and internal chains on this node (`m / 45' / cosigner_index / 0` and `m / 45' / cosigner_index / 1`):
174+
# derive the cosigner's node (<code>m / 45' / cosigner_index</code>)
175+
# for both the external and internal chains on this node (<code>m / 45' / cosigner_index / 0</code> and <code>m / 45' / cosigner_index / 1</code>):
176176
# scan addresses of the chain; respect the gap limit described below
177177
178178
Please note that the algorithm uses the transaction history, not address
@@ -182,7 +182,7 @@ even if the earlier ones don't have transactions
182182

183183
===Address gap limit===
184184

185-
Address gap limit is currently set to 20. If the software hits 20 unused
185+
Address gap limit is currently set to 20. If the software hits 20 unused
186186
addresses (no transactions associated with that address) in a row, it expects
187187
there are no used addresses beyond this point and stops searching the address chain.
188188

@@ -198,7 +198,7 @@ parties. Here are some explanations about the design decisions made.
198198
The reason for using separate branches for each cosigner is we don't want
199199
two of them generating the same address and receiving simultaneous payments
200200
to it. The ideal case is that each address receives at most one payment,
201-
requested by the corresponding cosigner.
201+
requested by the corresponding cosigner.
202202

203203
==Examples==
204204

0 commit comments

Comments
 (0)