sparrowwallet / sparrow

Desktop Bitcoin Wallet focused on security and privacy. Free and open source.
https://sparrowwallet.com/
Apache License 2.0
1.29k stars 185 forks source link

Implementing BIP for restoring fidelity bonds from seed phrases #616

Open chris-belcher opened 2 years ago

chris-belcher commented 2 years ago

Hello

I recently opened a PR to get a BIP number assigned for the standard for storing fidelity bonds in bip39 seed phrases. It can also be read on the gist: https://gist.github.com/chris-belcher/7257763cedcc014de2cd4239857cd36e

Fidelity bonds are really great, joinmarket already has hundreds of bitcoins locked up some for years, and this provides excellent protection from sybil attacks. Here's a thread explaining a bit: https://twitter.com/chris_belcher_/status/1432696845017436166 (Although the thread is several months old, the numbers are bigger now)

The fidelity bonds in joinmarket are held in bip39 seed phrases. It would be pretty nice if people could restore their fidelity bond coins by importing the same bip39 seed into another wallet, like Sparrow. Also it would allow for fidelity bonds to be held in cold storage, allowing the sybil resistance of such systems to increase without hot wallet risk.

Would you consider implementing this in Sparrow? Would you accept a PR if someone else implemented it?

Do consider having a look at the BIP itself, it's currently in the process of being assigned a BIP number.

craigraw commented 2 years ago

@chris-belcher looking into this - any progress on getting the BIP number assigned?

theborakompanioni commented 4 months ago

Any update on this? It would be nice to take this into consideration. Quite an improvement for a lot of users :pray:

theborakompanioni commented 2 months ago

@chris-belcher looking into this - any progress on getting the BIP number assigned?

"Address Scheme for Timelocked Fidelity Bonds" has been merged as BIP-46. :raised_hands:

cbeams commented 1 week ago

I just came upon this issue after spending a lot of time wondering where my new timelocked JoinMarket fidelity bond utxo actually "went" in my wallet after it was created. The JoinMarket web UI (Jam) told me it existed at derivation path m/84'/0'/0'/2/60:1735689600 (where 1735689600 is unix time for its unlock date), but I could find no such address/utxo/outpoint in the Sparrow wallet I'm using to watch my Jam wallet. I originally thought this was because my gap limit was too low (at the default value of 20) and that I should increase to >= 60 in order to catch the utxo at m/84'/0'/0'/2/60. I did that but still found nothing, i.e. found an altogether different address with zero balance at index 60 in my set of receiving addresses. I then realized that the 2 in m/84'/0'/0'/2/60 was nonstandard, being neither a receiving address (0) nor a change address (1), and I figured that 2 must by JM's way of "hiding away" its timelocked utxos. I then discovered on https://bips.dev/46/ and subsequently this issue.

It may be simplistic to suggest the following solution, but it seems to me that Sparrow having a generic option to display additional address type slots beyond the standard 0 (receiving) and 1 (change) OR having an dedicated option to display bip46 timelocked addresses under slot 2 would be an easy enough way to handle supporting wallets with these kind of timelocked utxos.

If the latter, bip46-specific feature were implemented, it would result in Sparrow having an Addresses tab consisting of Receive Addresses and Change Addresses sections as it does today, and it would then also have a third section titled Timelocked Addresses where these fidelity bond utxos would show up. And in the Transactions tab, the overview section could be updated to include a "Timelocked" balance that is displayed but perhaps excluded from the main "Balance" value.

Seems like issue #666 is related to this as well.

See also: https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/master/docs/fidelity-bonds.md#bip32-paths