Skip to content

Commit b628a13

Browse files
committed
BIP88: use <code> tags more, instead of double quotes
1 parent 01679c8 commit b628a13

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

bip-0088.mediawiki

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,17 @@ installation of malicious or incorrect profiles, though.
9191

9292
The format for the template was choosen to make it easy to read, convenient and visually unambigous.
9393

94-
Template starts with optional prefix "m/", and then one or more sections delimited by the slash character (<code>/</code>).
94+
Template starts with optional prefix <code>m/</code>, and then one or more sections delimited by the slash character (<code>/</code>).
9595

9696
Implementations MAY limit the maximum number of sections.
9797

98-
Each section consists of ''index template'', optionally followed by the hardened marker: either an apostrophe (<code>'</code>) or letter "h".
98+
Each section consists of ''index template'', optionally followed by the hardened marker: either an apostrophe (<code>'</code>) or letter <code>h</code>.
9999

100100
Index template can be:
101101

102102
* An integer value from 0 to 2147483647 ("Unit index template")
103-
* A single "*" character, which denotes any value from 0 to 2147483647 ("Wildcard index template")
104-
* The <nowiki>"{"</nowiki> character, followed by a number of ''index ranges'' delimited by commas (<code>,</code>), followed by <nowiki>"}"</nowiki> character ("Ranged index template")
103+
* A single <code>*</code> character, which denotes any value from 0 to 2147483647 ("Wildcard index template")
104+
* The <code>{</code> character, followed by a number of ''index ranges'' delimited by commas (<code>,</code>), followed by <code>}</code> character ("Ranged index template")
105105
106106
Implementations MAY limit the maximum number of index ranges within the Ranged index template.
107107

@@ -110,9 +110,9 @@ If an index template is immediately followed by hardened marker, this means that
110110
Index range can be:
111111

112112
* An integer value from 0 to 2147483647 ("Unit range")
113-
* An integer value from 0 to 2147483647, followed by the "-" character, followed by another integer value from 0 to 2147483647 ("Non-unit range")
113+
* An integer value from 0 to 2147483647, followed by the <code>-</code> character, followed by another integer value from 0 to 2147483647 ("Non-unit range")
114114
115-
For Non-unit range, value on the left side of the "-" character is the range_start, and the value on the right side of the "-" character is the range_end.
115+
For Non-unit range, value on the left side of the <code>-</code> character is the range_start, and the value on the right side of the <code>-</code> character is the range_end.
116116

117117
For Unit range, we say that range_start is equal to range_end, even though there is no start/end in the Unit range.
118118

@@ -128,26 +128,26 @@ Constraints:
128128
# To avoid ambiguity, an index range <code>0-2147483647</code> is not allowed, and MUST be specified as Wildcard index template instead
129129
# For Non-unit range, range_end MUST be larger than range_start.
130130
# If there is more than one index range within the Ranged index template, range_start of the second and any subsequent range MUST be larger than the range_end of the preceeding range.
131-
# To avoid ambiguity, all representations of integer values larger than 0 MUST NOT start with character "0" (no leading zeroes allowed).
131+
# To avoid ambiguity, all representations of integer values larger than 0 MUST NOT start with character <code>0</code> (no leading zeroes allowed).
132132
# If hardened marker appears within any section in the path template, all preceding sections MUST also specify hardened matching.
133133
# To avoid ambiguity, if a hardened marker appears within any section in the path template, all preceding sections MUST also use the same hardened marker (either <code>h</code> or <code>'</code>).
134-
# To avoid ambiguity, trailing slashes (for example, "1/2/") and duplicate slashes (for example, "0//1") MUST NOT appear in the template.
134+
# To avoid ambiguity, trailing slashes (for example, <code>1/2/</code>) and duplicate slashes (for example, <code>0//1</code>) MUST NOT appear in the template.
135135
136136
It may be desireable to have fully unambiguous encoding, where for each valid path template string, there is no other valid template string that matches the exact same set of paths. This would enable someone to compare templates for equality through a simple string equality check, without any parsing.
137137

138138
To achieve this, two extra rules are needed:
139139

140-
* Within Ranged index template, subsequent range MUST NOT start with the value that is equal to the end of the previous range plus one. Thus, <nowiki>"{1,2,3-5}"</nowiki> is not allowed, and should be specified as <nowiki>"{1-5}"</nowiki> instead. This rule might make templates less convenient for frequent edits, though.
140+
* Within Ranged index template, subsequent range MUST NOT start with the value that is equal to the end of the previous range plus one. Thus, <code>{1,2,3-5}</code> is not allowed, and should be specified as <code>{1-5}</code> instead. This rule might make templates less convenient for frequent edits, though.
141141
142142
* Only one type of hardened marker should be allowed (either <code>h</code> or <code>'</code>).
143143
144144
Instead of requiring the second extra rule, implementations can simply replace one type of marker with another in the template strings before comparing them.
145145

146146
==Full and partial templates==
147147

148-
If the template starts with "m/", that means that this is the "full" template, that matches the whole path.
148+
If the template starts with <code>m/</code>, that means that this is the "full" template, that matches the whole path.
149149

150-
If the template does not start with "m/", that means that this is a "partial" template, and it can be used to match a part of the path, in the contexts where this might be appropriate (for example, when constraints for the suffix of the path might be dynamic, while constraints for the prefix of the path are fixed).
150+
If the template does not start with <code>m/</code>, that means that this is a "partial" template, and it can be used to match a part of the path, in the contexts where this might be appropriate (for example, when constraints for the suffix of the path might be dynamic, while constraints for the prefix of the path are fixed).
151151

152152
Full template can be combined with partial template, where partial template extends full template,
153153
resulting in new, longer full template.
@@ -205,11 +205,11 @@ The full path template that only contains Unit index templates represents a full
205205

206206
There's no other path template standards that is known to the author currently.
207207

208-
There is a discussion on path templating for bitcoin script descriptors at https://github.com/bitcoin/bitcoin/issues/17190, which proposes the format '''"xpub...{0,1}/*"''', of which the '''"{0,1}/*"''' part would correspond to the partial path template in the format of this BIP.
208+
There is a discussion on path templating for bitcoin script descriptors at https://github.com/bitcoin/bitcoin/issues/17190, which proposes the format <code>xpub...{0,1}/*</code>, of which the <code>{0,1}/*</code> part would correspond to the partial path template in the format of this BIP.
209209

210210
==Examples==
211211

212-
'''"m/{44,49,84}'/0'/0'/{0-1}/{0-50000}"''' specifies a full template that matches both external and internal chains of BIP44, BIP49 and BIP84 paths, with a constraint that the address index cannot be larger than 50000
212+
<code>m/{44,49,84}'/0'/0'/{0-1}/{0-50000}</code> specifies a full template that matches both external and internal chains of BIP44, BIP49 and BIP84 paths, with a constraint that the address index cannot be larger than 50000
213213

214214
Its representation after parsing can be (using Python syntax, ignoring full/partial distinction):
215215
[[(2147483692, 2147483692), (2147483697, 2147483697), (2147483732, 2147483732)),
@@ -218,12 +218,12 @@ Its representation after parsing can be (using Python syntax, ignoring full/part
218218
[(0, 1)],
219219
[(0, 50000)]]
220220

221-
'''"{0-2,33,123}/*"''' specifies a partial template that matches non-hardened values 0, 1, 2, 33, 123 as first index, and any non-hardened value at second index
221+
<code>{0-2,33,123}/*</code> specifies a partial template that matches non-hardened values 0, 1, 2, 33, 123 as first index, and any non-hardened value at second index
222222

223223
Its representation after parsing can be:
224224
[[(0, 2), (33, 33), (123, 123)], [(0, 2147483647)]]
225225

226-
'''"*h/0"''' specifies a partial template that matches any hardened index followed by any non-hardened index
226+
<code>*h/0</code> specifies a partial template that matches any hardened index followed by any non-hardened index
227227

228228
Its representation after parsing can be:
229229
[[(2147483648, 4294967295)], [(0, 0)]]

0 commit comments

Comments
 (0)