Skip to content

Commit 0a5e3b0

Browse files
committed
add optional key origin property and expand truncation note
1 parent 1a632a3 commit 0a5e3b0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

bip-0329.mediawiki

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ It is also a convenient format for command-line processing, which is often line-
4444

4545
Further to the JSON Lines specification, an export of labels from a wallet must be a UTF-8 encoded text file, containing one record per line consisting of a valid JSON object.
4646
Lines are separated by <tt>\n</tt>. Multiline values are not permitted.
47-
Each JSON object must contain 3 key/value pairs, defined as follows:
47+
Each JSON object must contain 3 or 4 key/value pairs, defined as follows:
4848

4949
{| class="wikitable"
5050
|-
@@ -59,6 +59,9 @@ Each JSON object must contain 3 key/value pairs, defined as follows:
5959
|-
6060
| <tt>label</tt>
6161
| The label applied to the reference
62+
|-
63+
| <tt>origin</tt>
64+
| Optional key origin information referencing the wallet associated with the label
6265
|}
6366

6467
The reference is defined for each <tt>type</tt> as follows:
@@ -94,14 +97,17 @@ The reference is defined for each <tt>type</tt> as follows:
9497
| <tt>xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8Nq...</tt>
9598
|}
9699

100+
If present, the optional <tt>origin</tt> property must contain key origin information as defined by BIP380<ref>[https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki BIP-0380]</ref>, without the opening or closing brackets.
101+
This property should be used to disambiguate labels from different wallets contained in the same export, particularly when exporting multiple accounts derived from the same seed.
102+
97103
Care should be taken when exporting due to the privacy sensitive nature of the data.
98104
Encryption in transit over untrusted networks is highly recommended, and encryption at rest should also be considered.
99105
Unencrypted exports should be deleted as soon as possible.
100106
For security reasons no private key types are defined.
101107

102108
==Importing==
103109

104-
* An importing wallet may ignore records it does not store, and truncate labels if necessary.
110+
* An importing wallet may ignore records it does not store, and truncate labels if necessary. A suggested default for maximum label length is 255 characters, and an importing wallet should consider warning the user if truncation is applied.
105111
* Wallets importing public key records may derive addresses from them to match against known wallet addresses.
106112
* Wallets importing extended public keys may match them against signers, for example in a multisig setup.
107113
@@ -114,7 +120,7 @@ However, importing wallets complying to this specification may ignore types not
114120

115121
The following fragment represents a wallet label export:
116122
<pre>
117-
{ "type": "tx", "ref": "f91d0a8a78462bc59398f2c5d7a84fcff491c26ba54c4833478b202796c8aafd", "label": "Transaction" }
123+
{ "type": "tx", "ref": "f91d0a8a78462bc59398f2c5d7a84fcff491c26ba54c4833478b202796c8aafd", "label": "Transaction", "origin": "d34db33f/84'/0'/0'" }
118124
{ "type": "addr", "ref": "bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c", "label": "Address" }
119125
{ "type": "pubkey", "ref": "0283409659355b6d1cc3c32decd5d561abaac86c37a353b52895a5e6c196d6f448", "label": "Public Key" }
120126
{ "type": "input", "ref": "f91d0a8a78462bc59398f2c5d7a84fcff491c26ba54c4833478b202796c8aafd:0", "label": "Input" }

0 commit comments

Comments
 (0)