<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-25&#xA;📝 Original message:Thanks Clark - despite having worked in the Bitcoin wallet space for a&#xA;number of years I have not come across SLIP-0015. I did try to find prior&#xA;work on this - this one escaped me.&#xA;&#xA;That said, having reviewed SLIP-0015, I think it has different design&#xA;goals. For example, it requires private key derivation from seed, which&#xA;means wallets functioning as coordinators cannot use the format without&#xA;access to the devices storing the private keys. It seems to me that wallet&#xA;labels are more privacy rather than security sensitive, and coordinators&#xA;should be able to import and export a wallet label format independently.&#xA;&#xA;Secondly, it uses JSON as a data format, which I wanted to avoid for&#xA;reasons I&#39;ll describe in a separate reply in this thread. Finally (and this&#xA;is minor as it could easily be extended) SLIP-0015 does not currently&#xA;support transaction labels.&#xA;&#xA;Craig&#xA;&#xA;On Wed, Aug 24, 2022 at 3:53 PM Clark Moody &lt;clark at clarkmoody.com&gt; wrote:&#xA;&#xA;&gt; Craig,&#xA;&gt;&#xA;&gt; Thanks for the proposal.&#xA;&gt;&#xA;&gt; How does this proposal compare with SLIP-0015, which provides encryption&#xA;&gt; by default? Would it be worth exploring a merge of the two approaches?&#xA;&gt;&#xA;&gt; https://github.com/satoshilabs/slips/blob/master/slip-0015.md&#xA;&gt;&#xA;&gt; Clark&#xA;&gt;&#xA;&gt; ------- Original Message -------&#xA;&gt; On Wednesday, August 24th, 2022 at 4:18 AM, Craig Raw via bitcoin-dev &lt;&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt;&#xA;&gt; Hi all,&#xA;&gt;&#xA;&gt; I would like to propose a BIP that specifies a format for the export and&#xA;&gt; import of labels from a wallet. While transferring access to funds across&#xA;&gt; wallet applications has been made simple through standards such as BIP39,&#xA;&gt; wallet labels remain siloed and difficult to extract despite their value,&#xA;&gt; particularly in a privacy context.&#xA;&gt;&#xA;&gt; The proposed format is a simple two column CSV file, with the reference to&#xA;&gt; a transaction, address, input or output in the first column, and the label&#xA;&gt; in the second column. CSV was chosen for its wide accessibility, especially&#xA;&gt; to users without specific technical expertise. Similarly, the CSV file may&#xA;&gt; be compressed using the ZIP format, and optionally encrypted using AES.&#xA;&gt;&#xA;&gt; The full text of the BIP can be found at&#xA;&gt; https://github.com/craigraw/bips/blob/master/bip-wallet-labels.mediawiki&#xA;&gt; and also copied below.&#xA;&gt;&#xA;&gt; Feedback is appreciated.&#xA;&gt;&#xA;&gt; Thanks,&#xA;&gt; Craig Raw&#xA;&gt;&#xA;&gt; ---&#xA;&gt;&#xA;&gt; &lt;pre&gt;&#xA;&gt; BIP: wallet-labels&#xA;&gt; Layer: Applications&#xA;&gt; Title: Wallet Labels Export Format&#xA;&gt; Author: Craig Raw &lt;craig at sparrowwallet.com&gt;&#xA;&gt; Comments-Summary: No comments yet.&#xA;&gt; Comments-URI:&#xA;&gt; https://github.com/bitcoin/bips/wiki/Comments:BIP-wallet-labels&#xA;&gt; Status: Draft&#xA;&gt; Type: Informational&#xA;&gt; Created: 2022-08-23&#xA;&gt; License: BSD-2-Clause&#xA;&gt; &lt;/pre&gt;&#xA;&gt;&#xA;&gt; ==Abstract==&#xA;&gt;&#xA;&gt; This document specifies a format for the export of labels that may be&#xA;&gt; attached to the transactions, addresses, input and outputs in a wallet.&#xA;&gt;&#xA;&gt; ==Copyright==&#xA;&gt;&#xA;&gt; This BIP is licensed under the BSD 2-clause license.&#xA;&gt;&#xA;&gt; ==Motivation==&#xA;&gt;&#xA;&gt; The export and import of funds across different Bitcoin wallet&#xA;&gt; applications is well defined through standards such as BIP39, BIP32, BIP44&#xA;&gt; etc.&#xA;&gt; These standards are well supported and allow users to move easily between&#xA;&gt; different wallets.&#xA;&gt; There is, however, no defined standard to transfer any labels the user may&#xA;&gt; have applied to the transactions, addresses, inputs or outputs in their&#xA;&gt; wallet.&#xA;&gt; The UTXO model that Bitcoin uses makes these labels particularly valuable&#xA;&gt; as they may indicate the source of funds, whether received externally or as&#xA;&gt; a result of change from a prior transaction.&#xA;&gt; In both cases, care must be taken when spending to avoid undesirable leaks&#xA;&gt; of private information.&#xA;&gt; Labels provide valuable guidance in this regard, and have even become&#xA;&gt; mandatory when spending in several Bitcoin wallets.&#xA;&gt; Allowing users to export their labels in a standardized way ensures that&#xA;&gt; they do not experience lock-in to a particular wallet application.&#xA;&gt; In addition, by using common formats, this BIP seeks to make manual or&#xA;&gt; bulk management of labels accessible to users without specific technical&#xA;&gt; expertise.&#xA;&gt;&#xA;&gt; ==Specification==&#xA;&gt;&#xA;&gt; In order to make the import and export of labels as widely accessible as&#xA;&gt; possible, this BIP uses the comma separated values (CSV) format, which is&#xA;&gt; widely supported by consumer, business, and scientific applications.&#xA;&gt; Although the technical specification of CSV in RFC4180 is not always&#xA;&gt; followed, the application of the format in this BIP is simple enough that&#xA;&gt; compatibility should not present a problem.&#xA;&gt; Moreover, the simplicity and forgiving nature of CSV (over for example&#xA;&gt; JSON) lends itself well to bulk label editing using spreadsheet and text&#xA;&gt; editing tools.&#xA;&gt;&#xA;&gt; A CSV export of labels from a wallet must be a UTF-8 encoded text file,&#xA;&gt; containing one record per line, with records containing two fields&#xA;&gt; delimited by a comma.&#xA;&gt; The fields may be quoted, but this is unnecessary, as the first comma in&#xA;&gt; the line will always be the delimiter.&#xA;&gt; The first line in the file is a header, and should be ignored on import.&#xA;&gt; Thereafter, each line represents a record that refers to a label applied&#xA;&gt; in the wallet.&#xA;&gt; The order in which these records appear is not defined.&#xA;&gt;&#xA;&gt; The first field in the record contains a reference to the transaction,&#xA;&gt; address, input or output in the wallet.&#xA;&gt; This is specified as one of the following:&#xA;&gt; * Transaction ID (&lt;tt&gt;txid&lt;/tt&gt;)&#xA;&gt; * Address&#xA;&gt; * Input (rendered as &lt;tt&gt;txid&lt;index&lt;/tt&gt;)&#xA;&gt; * Output (rendered as &lt;tt&gt;txid&gt;index&lt;/tt&gt; or &lt;tt&gt;txid:index&lt;/tt&gt;)&#xA;&gt;&#xA;&gt; The second field contains the label applied to the reference.&#xA;&gt; Exporting applications may omit records with no labels or labels of zero&#xA;&gt; length.&#xA;&gt; Files exported should use the &lt;tt&gt;.csv&lt;/tt&gt; file extension.&#xA;&gt;&#xA;&gt; In order to reduce file size while retaining wide accessibility, the CSV&#xA;&gt; file may be compressed using the ZIP file format, using the &lt;tt&gt;.zip&lt;/tt&gt;&#xA;&gt; file extension.&#xA;&gt; This &lt;tt&gt;.zip&lt;/tt&gt; file may optionally be encrypted using either AES-128&#xA;&gt; or AES-256 encryption, which is supported by numerous applications&#xA;&gt; including Winzip and 7-zip.&#xA;&gt; In order to ensure that weak encryption does not proliferate, importers&#xA;&gt; following this standard must refuse to import &lt;tt&gt;.zip&lt;/tt&gt; files encrypted&#xA;&gt; with the weaker Zip 2.0 standard.&#xA;&gt; The textual representation of the wallet&#39;s extended public key (as defined&#xA;&gt; by BIP32, with an &lt;tt&gt;xpub&lt;/tt&gt; header) should be used as the password.&#xA;&gt;&#xA;&gt; ==Importing==&#xA;&gt;&#xA;&gt; When importing, a naive algorithm may simply match against any reference,&#xA;&gt; but it is possible to disambiguate between transactions, addresses, inputs&#xA;&gt; and outputs.&#xA;&gt; For example in the following pseudocode:&#xA;&gt; &lt;pre&gt;&#xA;&gt; if reference length &lt; 64&#xA;&gt; Set address label&#xA;&gt; else if reference length == 64&#xA;&gt; Set transaction label&#xA;&gt; else if reference contains &#39;&lt;&#39;&#xA;&gt; Set input label&#xA;&gt; else&#xA;&gt; Set output label&#xA;&gt; &lt;/pre&gt;&#xA;&gt;&#xA;&gt; Importing applications may truncate labels if necessary.&#xA;&gt;&#xA;&gt; ==Test Vectors==&#xA;&gt;&#xA;&gt; The following fragment represents a wallet label export:&#xA;&gt; &lt;pre&gt;&#xA;&gt; Reference,Label&#xA;&gt;&#xA;&gt; c3bdad6e7dcd7997e16a5b7b7cf4d8f6079820ff2eedd5fcbb2ad088f767b37b‎,Transaction&#xA;&gt; 1A69TXnEM2ms9fMaY9UuiJ7415X7xZaUSg,Address&#xA;&gt; c3bdad6e7dcd7997e16a5b7b7cf4d8f6079820ff2eedd5fcbb2ad088f767b37b‎&lt;0,Input&#xA;&gt; c3bdad6e7dcd7997e16a5b7b7cf4d8f6079820ff2eedd5fcbb2ad088f767b37b‎&gt;0,Output&#xA;&gt; c3bdad6e7dcd7997e16a5b7b7cf4d8f6079820ff2eedd5fcbb2ad088f767b37b‎:0,Output&#xA;&gt; (alternative)&#xA;&gt; &lt;/pre&gt;&#xA;&gt;&#xA;&gt; ==Reference Implementation==&#xA;&gt;&#xA;&gt; TBD&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220825/acdd8972/attachment-0001.html&gt;</html></oembed>