Introduced support for backward-compatible BIP-329 import and BIP-329 export. Bounty by @nvk#8614
Introduced support for backward-compatible BIP-329 import and BIP-329 export. Bounty by @nvk#8614xavierfiechter wants to merge 1 commit into
Conversation
|
Thanks for the pull request. A few remarks:
|
|
Hi @ecdsa @nvk has actually put up a bounty for the development of a BIP-329 label export plugin for Electrum, which was discussed in the Bitcoin Review podcast episode 51. This indicates a genuine interest within the community for this feature. Plugins in general are designed to be non-invasive and extend the functionality. I did not want to remove existing features that others may rely on. So, plugins are not limited to third-party services IMHO, and they enhance the user experience by introducing new standards like BIP-329. The motivation behind implementing BIP-329 is to establish a standardized format that works seamlessly across different Bitcoin wallet applications and services. This ensures the portability of labels, even in air-gapped environments. You said, "Instead of adding a new format, why not replace the existing import/export format with BIP329?" If you are open to accepting a pull request that replaces the current export/import format with BIP-329, I propose merging this PR now to make BIP-329 available as soon as possible. In the coming months, I can submit another PR to replace the current label export/import functionality with BIP-329 and remove the plugin, as suggested. Why do I care? I'd like to mention that I am actively working on labelbase.space, a service that leverages the BIP-329 standard to provide label synchronization across various wallets and systems. Labelbase offers both manual import/export options and API-based synchronization. This demonstrates real-world use cases for the proposed BIP-329. Additionally, I have received a grant from OpenSats.org to continue developing Labelbase. This grant provides me with the flexibility to dedicate time and effort to such a pull request if Electrum is interested. |
|
I concur with ecdsa. We do not want two formats for exporting labels. It just leads to user-confusion and maintenance burden for us. Now that there is a ~standardised format for it, it would be better to replace our custom format instead of also adding the new one. I don't see why this should be a plugin. Also, we would also want to import using this format, not just export. I am not sure why you would only add export functionality. Ideally, it would be nice if we could import using both the old format and the new one, but not expose this to the UI (instead, the parser should just automatically detect the format). Ideally there should be a unit test that imports labels using old format and another that imports labels using the new format. Re exporting, only support the new format. |
|
Okay, I'm going to replace the labels 'export' and 'import' while implementing BIP-329. |
|
Okay, with commit e96d945 I eliminated the previously added plugin components and introduced support for backward-compatible BIP-329 import and BIP-329 export. UTXOs are frozen or unfrozen based on the "spendable" parameter, if available. I have successfully tested various scenarios. IMHO, this PR is now ready to review, and merge. |
|
your PR includes commits from master. |
|
https://github.com/spesmilo/electrum/pull/8614/files shows the changes w/o the previous plugin code and w/o commits from master. Do I really need to squash the commits? If so, I would still have to find out how squashing commits is done. |
First, rebase onto spesmilo/master to get rid of the merge commits You can then combine the two remaining commits with finally, send the rewritten history to github: |
2898445 to
11b6e0b
Compare
11b6e0b to
2e835c2
Compare
|
Okay, @accumulator @ecdsa @SomberNight now we have 1 commit. Let me know if anything else should be modified. |
Can the tests be triggered manually? |
2e835c2 to
b84a44b
Compare
|
you can run the tests locally on your machine, for example |
|
you can see that the flake8 test is not passing. just click on the "details" link to see the error. |
|
Got on my local machine. |
|
indeed, that flake8 issue comes from master. but it has been fixed two days ago. |
b84a44b to
57b8a9d
Compare
|
@ecdsa all green, all good. |
|
I'd rather see the code in So in short, refactor See also https://docs.python.org/3/library/io.html for how |
57b8a9d to
31e7110
Compare
31e7110 to
ed2682b
Compare
|
@accumulator I reworked the PR as requested. |
|
It is a bit ugly to replicate the for loop that calls Also, import labels calls Note: it seems that |
|
Thank you, @ecdsa, for your feedback. I appreciate the thorough review. I am very eager to get BIP-329 support into Electrum and am open to adjusting the implementation if this is a blocker. Could you please advise on the specific changes required to get the PR merged? Regarding your note about the design choice: BIP-329 focuses on freezing outputs (`spendable=false?) rather than addresses because outputs are the actual entities used as inputs in future transactions. Freezing an address alone is ineffective if the address is reused, since it does not specify which specific outputs should be frozen. Electrum handles this by preventing the spending of outputs from frozen addresses. Flagging all outputs associated with an address as |
|
@accumulator @ecdsa can we look into this again? Would love to have export as well as import covered, and Electrum listed on https://bip329.org. |
|
Hello, is this PR ever going to merge? I would like to use this feature. |
|
@ecdsa I'm still available to work on this one :) |
|
I rebased this PR to the current version of master and fixed some minor conflicts to test it with my wallet. The export works but I got only 7 out of 10 tx labels and 1 out of 8 output labels in my text file. |


No description provided.