<oembed><type>rich</type><version>1.0</version><author_name>npub1qvg3k0w2c3ggh4wumg3pkzetfeqe9y4wgq7x5aaxz4ypjvap9vksr9t9zs</author_name><author_url>https://nostr.ae/npub1qvg3k0w2c3ggh4wumg3pkzetfeqe9y4wgq7x5aaxz4ypjvap9vksr9t9zs</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2022-08-24&#xA;📝 Original message:Hi all,&#xA;&#xA;I would like to propose a BIP that specifies a format for the export and&#xA;import of labels from a wallet. While transferring access to funds across&#xA;wallet applications has been made simple through standards such as BIP39,&#xA;wallet labels remain siloed and difficult to extract despite their value,&#xA;particularly in a privacy context.&#xA;&#xA;The proposed format is a simple two column CSV file, with the reference to&#xA;a transaction, address, input or output in the first column, and the label&#xA;in the second column. CSV was chosen for its wide accessibility, especially&#xA;to users without specific technical expertise. Similarly, the CSV file may&#xA;be compressed using the ZIP format, and optionally encrypted using AES.&#xA;&#xA;The full text of the BIP can be found at&#xA;https://github.com/craigraw/bips/blob/master/bip-wallet-labels.mediawiki&#xA;and also copied below.&#xA;&#xA;Feedback is appreciated.&#xA;&#xA;Thanks,&#xA;Craig Raw&#xA;&#xA;---&#xA;&#xA;&lt;pre&gt;&#xA;  BIP: wallet-labels&#xA;  Layer: Applications&#xA;  Title: Wallet Labels Export Format&#xA;  Author: Craig Raw &lt;craig at sparrowwallet.com&gt;&#xA;  Comments-Summary: No comments yet.&#xA;  Comments-URI:&#xA;https://github.com/bitcoin/bips/wiki/Comments:BIP-wallet-labels&#xA;  Status: Draft&#xA;  Type: Informational&#xA;  Created: 2022-08-23&#xA;  License: BSD-2-Clause&#xA;&lt;/pre&gt;&#xA;&#xA;==Abstract==&#xA;&#xA;This document specifies a format for the export of labels that may be&#xA;attached to the transactions, addresses, input and outputs in a wallet.&#xA;&#xA;==Copyright==&#xA;&#xA;This BIP is licensed under the BSD 2-clause license.&#xA;&#xA;==Motivation==&#xA;&#xA;The export and import of funds across different Bitcoin wallet applications&#xA;is well defined through standards such as BIP39, BIP32, BIP44 etc.&#xA;These standards are well supported and allow users to move easily between&#xA;different wallets.&#xA;There is, however, no defined standard to transfer any labels the user may&#xA;have applied to the transactions, addresses, inputs or outputs in their&#xA;wallet.&#xA;The UTXO model that Bitcoin uses makes these labels particularly valuable&#xA;as they may indicate the source of funds, whether received externally or as&#xA;a result of change from a prior transaction.&#xA;In both cases, care must be taken when spending to avoid undesirable leaks&#xA;of private information.&#xA;Labels provide valuable guidance in this regard, and have even become&#xA;mandatory when spending in several Bitcoin wallets.&#xA;Allowing users to export their labels in a standardized way ensures that&#xA;they do not experience lock-in to a particular wallet application.&#xA;In addition, by using common formats, this BIP seeks to make manual or bulk&#xA;management of labels accessible to users without specific technical&#xA;expertise.&#xA;&#xA;==Specification==&#xA;&#xA;In order to make the import and export of labels as widely accessible as&#xA;possible, this BIP uses the comma separated values (CSV) format, which is&#xA;widely supported by consumer, business, and scientific applications.&#xA;Although the technical specification of CSV in RFC4180 is not always&#xA;followed, the application of the format in this BIP is simple enough that&#xA;compatibility should not present a problem.&#xA;Moreover, the simplicity and forgiving nature of CSV (over for example&#xA;JSON) lends itself well to bulk label editing using spreadsheet and text&#xA;editing tools.&#xA;&#xA;A CSV export of labels from a wallet must be a UTF-8 encoded text file,&#xA;containing one record per line, with records containing two fields&#xA;delimited by a comma.&#xA;The fields may be quoted, but this is unnecessary, as the first comma in&#xA;the line will always be the delimiter.&#xA;The first line in the file is a header, and should be ignored on import.&#xA;Thereafter, each line represents a record that refers to a label applied in&#xA;the wallet.&#xA;The order in which these records appear is not defined.&#xA;&#xA;The first field in the record contains a reference to the transaction,&#xA;address, input or output in the wallet.&#xA;This is specified as one of the following:&#xA;* Transaction ID (&lt;tt&gt;txid&lt;/tt&gt;)&#xA;* Address&#xA;* Input (rendered as &lt;tt&gt;txid&lt;index&lt;/tt&gt;)&#xA;* Output (rendered as &lt;tt&gt;txid&gt;index&lt;/tt&gt; or &lt;tt&gt;txid:index&lt;/tt&gt;)&#xA;&#xA;The second field contains the label applied to the reference.&#xA;Exporting applications may omit records with no labels or labels of zero&#xA;length.&#xA;Files exported should use the &lt;tt&gt;.csv&lt;/tt&gt; file extension.&#xA;&#xA;In order to reduce file size while retaining wide accessibility, the CSV&#xA;file may be compressed using the ZIP file format, using the &lt;tt&gt;.zip&lt;/tt&gt;&#xA;file extension.&#xA;This &lt;tt&gt;.zip&lt;/tt&gt; file may optionally be encrypted using either AES-128 or&#xA;AES-256 encryption, which is supported by numerous applications including&#xA;Winzip and 7-zip.&#xA;In order to ensure that weak encryption does not proliferate, importers&#xA;following this standard must refuse to import &lt;tt&gt;.zip&lt;/tt&gt; files encrypted&#xA;with the weaker Zip 2.0 standard.&#xA;The textual representation of the wallet&#39;s extended public key (as defined&#xA;by BIP32, with an &lt;tt&gt;xpub&lt;/tt&gt; header) should be used as the password.&#xA;&#xA;==Importing==&#xA;&#xA;When importing, a naive algorithm may simply match against any reference,&#xA;but it is possible to disambiguate between transactions, addresses, inputs&#xA;and outputs.&#xA;For example in the following pseudocode:&#xA;&lt;pre&gt;&#xA;  if reference length &lt; 64&#xA;    Set address label&#xA;  else if reference length == 64&#xA;    Set transaction label&#xA;  else if reference contains &#39;&lt;&#39;&#xA;    Set input label&#xA;  else&#xA;    Set output label&#xA;&lt;/pre&gt;&#xA;&#xA;Importing applications may truncate labels if necessary.&#xA;&#xA;==Test Vectors==&#xA;&#xA;The following fragment represents a wallet label export:&#xA;&lt;pre&gt;&#xA;Reference,Label&#xA;c3bdad6e7dcd7997e16a5b7b7cf4d8f6079820ff2eedd5fcbb2ad088f767b37b‎,Transaction&#xA;1A69TXnEM2ms9fMaY9UuiJ7415X7xZaUSg,Address&#xA;c3bdad6e7dcd7997e16a5b7b7cf4d8f6079820ff2eedd5fcbb2ad088f767b37b‎&lt;0,Input&#xA;c3bdad6e7dcd7997e16a5b7b7cf4d8f6079820ff2eedd5fcbb2ad088f767b37b‎&gt;0,Output&#xA;c3bdad6e7dcd7997e16a5b7b7cf4d8f6079820ff2eedd5fcbb2ad088f767b37b‎:0,Output&#xA;(alternative)&#xA;&lt;/pre&gt;&#xA;&#xA;==Reference Implementation==&#xA;&#xA;TBD&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220824/025a538b/attachment.html&gt;</html></oembed>