You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bip-0329.mediawiki
+21-14Lines changed: 21 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,38 +146,45 @@ wallet generating the export, and yet would be hard or impossible
146
146
for importing tools to reconstruct.
147
147
148
148
All of the following values are optional for exporter to provide,
149
-
but should be given if they are readily on-hand.
149
+
but should be given if they are readily available.
150
150
151
151
=== Transactions ===
152
152
153
-
* `height`: an integer giving the block height where this fully-confirmed transaction can be found.
154
-
Omit for transactions that are confirmed by less than 6 blocks, or use value zero.
153
+
* <tt>height</tt>: An integer giving the block height where this fully-confirmed transaction can be found. Omit for transactions that are confirmed by less than 6 blocks, or use value zero.
155
154
156
-
* `time`: ISO-8601 formated timestamp of the block given by height, preferably in UTC.
157
-
Example: `2025-01-23T11:40:35-05:00`.
155
+
* <tt>time</tt>: ISO-8601 formatted timestamp of the block given by height, preferably in UTC, although ISO-8601 can represent local times. Example: <tt>2025-01-23T11:40:35-05:00</tt>.
158
156
159
-
* `fee`: integer giving the number of Satoshis that went to the miner for this transaction.
157
+
* <tt>fee</tt>: Integer giving the number of Satoshis that went to the miner for this transaction.
158
+
159
+
* <tt>rate</tt>: Exchange rate at time of transaction. This is the fiat value of a Bitcoin at the time of the transaction, based on user preferences for data source. Example: <tt>"rate": { "USD": 105620.00 }</tt>
160
160
161
161
=== Address, Inputs, and Outputs ===
162
162
163
-
* `keypath`: the data needed to build full descriptor down to the specific address.
164
-
This extends `origin` with the final two components are are unhardened (in the typical case,
165
-
assuming BIP-84). Provide string `/1/123` for `wpkh([d34db33f/84'/0'/0'/1/123])`. If
166
-
the first character is not `/`, then it should be interpreted as a full descriptior,
167
-
independant of `origin` (if any).
163
+
* <tt>keypath</tt>: The data needed to build full descriptor down to the specific address. This extends <tt>origin</tt> with the final two components are are unhardened (in the typical case, assuming BIP-84). Provide string <tt>/1/123</tt> for <tt>wpkh([d34db33f/84'/0'/0'/1/123])</tt>. If the first character is not <tt>/</tt>, then it should be interpreted as a full descriptor, independant of <tt>origin</tt> (if any).
168
164
169
165
=== Inputs, and Outputs ===
170
166
171
-
* `value`: integer with the number of Satoshis (`nValue`) of the input or output.
167
+
* <tt>value</tt>: Integer with the number of Satoshis (<tt>nValue</tt>) of the input or output.
168
+
169
+
* <tt>fmv</tt>: Fair market value of the input/output relative to some other currency, typically fiat. The value should be a mapping, from currency code to decimal number. Example: <tt>"fmv": { "USD": 1233.45 }</tt>. Most situations will have only a single currency value, and it represents the real price of the goods/services expressed in some fiat currency. This is not an exchange *rate*, but an absolute value. By dividing by the <tt>value</tt> (above), it is possible to calculate an effective change rate for the transaction.
170
+
172
171
173
172
=== Address ===
174
173
175
-
* `heights`: a list of block heights which contain inputs which deposit to the address.
174
+
* <tt>heights</tt>: a list of block heights which contain inputs which deposit to the address.
175
+
176
+
== Comment on Types in JSON ==
176
177
178
+
JSON can serialize a number of basic types, including string, integer
179
+
and boolean (true/false). Decimal values (<tt>123.45</tt>) can
180
+
also be serialized, but some parsing libraries may interpret them as floating
181
+
point values which is generally not what we want in financial applications.
182
+
When hand-crafting JSON data, be careful not to write <tt>"false"</tt> (with quotes),
183
+
since that is a string with 5 characters and not a boolean.
0 commit comments