Specify BIP-fidelity-bonds #1341

pull chris-belcher wants to merge 1 commits into bitcoin:master from chris-belcher:bip-fidelity-bonds changing 1 files +167 −0
  1. chris-belcher commented at 5:49 pm on July 2, 2022: contributor

    This adds a BIP for a standard for storing fidelity bonds in BIP39 seed phrases.

    Preferably the BIP number will be a two-digit number to match the BIP44, BIP49, BIP84, BIP86 family of BIPs. Alternatively if a three-digit number is the only way then I suggest BIP-842 because it matches the bip32 derivation path m / 84' / 0' / 0' / 2 / index

  2. apoelstra commented at 1:14 pm on July 4, 2022: contributor
    This doesn’t actually use BIP39 – I think it would be clearer and more general to just say “storing fidelity bonds in BIP32 hierarchical trees” and leave the encoding of the master seed out of scope.
  3. Specify BIP-fidelity-bonds
    For storing fidelity bonds in HD wallets
    bf2eb4f680
  4. chris-belcher force-pushed on Jul 4, 2022
  5. chris-belcher commented at 7:12 pm on July 4, 2022: contributor
    Good thinking. I checked the other similar BIPs and I see they don’t mention BIP39 either.
  6. luke-jr commented at 9:36 pm on July 25, 2022: member
    Needs a section to address backward compatibility (even if it simply explains why it’s not applicable)
  7. jonatack added the label New BIP on Apr 26, 2024
  8. jonatack commented at 10:22 pm on April 26, 2024: contributor
    @chris-belcher are you still working on this?
  9. murchandamus added the label PR Author action required on May 8, 2024
  10. theborakompanioni commented at 10:31 pm on May 13, 2024: contributor

    @chris-belcher are you still working on this?

    If I am not mistaken, last activity from Chris regarding this was ~2 years ago. @luke-jr Is a section about backward compatibility all that is needed to progress this further?

  11. in bip-fidelity-bonds.mediawiki:26 in bf2eb4f680
    21+
    22+It would be useful to have a common derivation scheme so that users of wallet software can have a backup of their fidelity bonds by storing only the HD seed and a reference to this BIP. Importantly the user does not need to backup any timelock values.
    23+
    24+We largely use the same approach used in BIPs 49, 84 and 86 for ease of implementation.
    25+
    26+This standard is already implemented and deployed in JoinMarket. As most changes would requires a protocol change of a live system, there is limited scope for changing this standard in review. This BIP is more about documenting something which already exists, warts and all.
    


    murchandamus commented at 1:33 pm on May 14, 2024:
    0This standard is already implemented and deployed in JoinMarket. As most changes would require a protocol change of a live system, there is limited scope for changing this standard in review. This BIP is more about documenting something which already exists, warts and all.
    
  12. in bip-fidelity-bonds.mediawiki:10 in bf2eb4f680
     5+  Author: Chris Belcher <belcher@riseup.net>
     6+  Status: Draft
     7+  Type: Standards Track
     8+  Comments-Summary: No comments yet.
     9+  Created: 2022-04-01
    10+  License: CC0-1.0
    


    murchandamus commented at 1:36 pm on May 14, 2024:
    This document is missing the Copyright section.
  13. in bip-fidelity-bonds.mediawiki:6 in bf2eb4f680
    0@@ -0,0 +1,167 @@
    1+<pre>
    2+  BIP: TBD. Preferably a two-digit number to match the bip44, bip49, bip84, bip86 family of bips
    3+  Layer: Applications
    4+  Title: Derivation scheme for timelocked address fidelity bond based accounts
    5+  Author: Chris Belcher <belcher@riseup.net>
    6+  Status: Draft
    


    murchandamus commented at 1:37 pm on May 14, 2024:
    0  Author: Chris Belcher <belcher@riseup.net>
    1  Comments-URI: <links to wiki page for comments>
    2  Status: Draft
    

    Missing Comments-URI header

  14. in bip-fidelity-bonds.mediawiki:8 in bf2eb4f680
    0@@ -0,0 +1,167 @@
    1+<pre>
    2+  BIP: TBD. Preferably a two-digit number to match the bip44, bip49, bip84, bip86 family of bips
    3+  Layer: Applications
    4+  Title: Derivation scheme for timelocked address fidelity bond based accounts
    5+  Author: Chris Belcher <belcher@riseup.net>
    6+  Status: Draft
    7+  Type: Standards Track
    8+  Comments-Summary: No comments yet.
    


    murchandamus commented at 1:38 pm on May 14, 2024:

    Comments-Summary header is out of order (and optional).

  15. in bip-fidelity-bonds.mediawiki:55 in bf2eb4f680
    50+It would be useful for the user to avoid having to keep a record of the timelocks in the time-locked addresses. So only a limited small set of timelocks are defined by this BIP. This way the user must only store their seed phrase, and knowledge that they have coins stored using this BIP standard. The user doesn't need to remember or store any dates.
    51+
    52+
    53+== Specifications ==
    54+
    55+This BIP defines the two needed steps to derive multiple deterministic addresses based on a [[bip-0032.mediawiki|BIP 32]] master private key. It also defines the format of the certificate can be signed by the deterministic address key.
    


    murchandamus commented at 1:43 pm on May 14, 2024:

    There seems to be a missing word here:

    0This BIP defines the two needed steps to derive multiple deterministic addresses based on a [[bip-0032.mediawiki|BIP 32]] master private key. It also defines the format of the certificate that can be signed by the deterministic address key.
    
  16. in bip-fidelity-bonds.mediawiki:82 in bf2eb4f680
    77+</pre>
    78+
    79+
    80+=== Address derivation ===
    81+
    82+To derive the address from the above calculated public key and timelock, we create a <tt>redeemScript</tt> which locks the funds until the <tt>timelock</tt>, and then checks the signature of the <tt>derived_key</tt>. The <tt>redeemScript</tt> is hashed with SHA256 to produce a 32-byte hash value that forms the <tt>scriptPubKey</tt> of the P2WSH address.
    


    murchandamus commented at 1:47 pm on May 14, 2024:

    Here and elsewhere: redeemScripts only appear in the context of P2SH, the corresponding script is called a witness script in the context of P2WSH.

    0To derive the address from the above calculated public key and timelock, we create a <tt>witness script</tt> which locks the funds until the <tt>timelock</tt>, and then checks the signature of the <tt>derived_key</tt>. The <tt>witness script</tt> is hashed with SHA256 to produce a 32-byte hash value that forms the <tt>scriptPubKey</tt> of the P2WSH address.
    
  17. in bip-fidelity-bonds.mediawiki:84 in bf2eb4f680
    79+
    80+=== Address derivation ===
    81+
    82+To derive the address from the above calculated public key and timelock, we create a <tt>redeemScript</tt> which locks the funds until the <tt>timelock</tt>, and then checks the signature of the <tt>derived_key</tt>. The <tt>redeemScript</tt> is hashed with SHA256 to produce a 32-byte hash value that forms the <tt>scriptPubKey</tt> of the P2WSH address.
    83+
    84+    redeemScript: <timelock> OP_CHECKLOCKTIMEVERIFY OP_DROP <derived_key> OP_CHECKSIG
    


    murchandamus commented at 1:48 pm on May 14, 2024:
    0    witnessScript: <timelock> OP_CHECKLOCKTIMEVERIFY OP_DROP <derived_key> OP_CHECKSIG
    
  18. in bip-fidelity-bonds.mediawiki:92 in bf2eb4f680
    87+    scriptPubKey: 0 <32-byte-hash>
    88+                  (0x0020{32-byte-hash})
    89+
    90+=== Message signing ===
    91+
    92+In order to support signing of certificates, implementors should support signing ascii messages.
    


    murchandamus commented at 1:50 pm on May 14, 2024:

    Here and elsewhere: ascii ↦ ASCII

    0In order to support signing of certificates, implementors should support signing ASCII messages.
    
  19. in bip-fidelity-bonds.mediawiki:72 in bf2eb4f680
    67+
    68+For <tt>index</tt>, addresses are numbered from 0 in a sequentially increasing manner, but index does not increase forever like in other similar standards. The index only goes up to <tt>959</tt> inclusive. Only 960 addresses can be derived for a given BIP32 master key. Furthermore there is no concept of a gap limit, instead wallets must always generate all 960 addresses and check all of them if they have a balance and history.
    69+
    70+=== Timelock derivation ===
    71+
    72+The timelock used in the time-locked address is derived from the <tt>index</tt>. The timelock is a unix time. It is always the first of the month at midnight. The <tt>index</tt> counts upwards the months from January 2020, ending in December 2099. At 12 months per year for 80 years this totals 960 timelocks. Note that care must be taken with the year 2038 problem on 32-bit systems.
    


    murchandamus commented at 1:57 pm on May 14, 2024:
    Given that this BIP documents an existing standard, it’s probably too late to change, but midnight is an unfortunate time to use because it may be ambiguous to readers whether it refers to the start or the end of the day. It would be nice if this section could be clarified in this regard.
  20. in bip-fidelity-bonds.mediawiki:4 in bf2eb4f680
    0@@ -0,0 +1,167 @@
    1+<pre>
    2+  BIP: TBD. Preferably a two-digit number to match the bip44, bip49, bip84, bip86 family of bips
    3+  Layer: Applications
    4+  Title: Derivation scheme for timelocked address fidelity bond based accounts
    


    murchandamus commented at 2:20 pm on May 14, 2024:

    Title exceeds 44 characters. How about:

    0  Title: Timelocked Address Fidelity Bond
    

    or:

    0  Title: Address Scheme for Timelocked Fidelity Bonds
    
  21. murchandamus commented at 2:35 pm on May 14, 2024: contributor

    This BIP seems mostly complete to me. There are some formatting issues:

    • It is missing a Rationale section that explains design decisions, alternate designs and related work
    • It is missing a Backwards Compatibility section
    • It is missing a Copyright section

    and a few minor suggestions in line.

  22. murchandamus commented at 2:56 pm on May 14, 2024: contributor

    If I am not mistaken, last activity from Chris regarding this was ~2 years ago. @luke-jr Is a section about backward compatibility all that is needed to progress this further? @theborakompanioni: My understanding is that Chris unfortunately cannot work due to health reasons at this time. Would you be interested in working on addressing the open review comments?

  23. theborakompanioni commented at 8:37 am on May 15, 2024: contributor

    If I am not mistaken, last activity from Chris regarding this was ~2 years ago. @luke-jr Is a section about backward compatibility all that is needed to progress this further?

    @theborakompanioni: My understanding is that Chris unfortunately cannot work due to health reasons at this time. Would you be interested in working on addressing the open review comments?

    Yes, if it is only these small higher level changes, I am interested. Would you possibly be so kind as to let me know how to proceed? I have read section “Transferring BIP Ownership” in BIP-02 and formally propose to the original author @chris-belcher and the current BIP editors (representative @murchandamus) to address the open review comments. Should a new PR be created and this one closed subsequently? Thank you :pray:

  24. murchandamus commented at 2:44 pm on May 15, 2024: contributor

    Yes, if it is only these small higher level changes, I am interested. @theborakompanioni: Great, glad to hear that. Given the circumstances, I unfortunately don’t anticipate to hear from @chris-belcher, but let’s give him a week as a “reasonable amount of time” to respond.

    It will probably be the easiest to open a new PR that supersedes this one. I would suggest that you start with the commits in this branch and then append your own commits, that would make it the easiest for any interested parties to keep track of the amendment’s since Chris’s draft. You could open it already, while we are waiting for Chris’s response, though.

  25. murchandamus commented at 2:44 pm on May 15, 2024: contributor
    Let’s call this BIP-46.
  26. theborakompanioni commented at 8:17 am on May 16, 2024: contributor

    Yes, if it is only these small higher level changes, I am interested.

    @theborakompanioni: Great, glad to hear that. Given the circumstances, I unfortunately don’t anticipate to hear from @chris-belcher, but let’s give him a week as a “reasonable amount of time” to respond.

    :+1:

    It will probably be the easiest to open a new PR that supersedes this one. I would suggest that you start with the commits in this branch and then append your own commits, that would make it the easiest for any interested parties to keep track of the amendment’s since Chris’s draft.

    Thank you, will do! :+1:

    You could open it already, while we are waiting for Chris’s response, though.

    I will respect the one week waiting period and start working once it has been approved and acknowledged. :pray:

    Let’s call this BIP-46.

    Perfect.

  27. murchandamus commented at 1:08 pm on May 23, 2024: contributor
    Work on this pull request is continuing in #1599
  28. NikolaiNikolaevichBoyko approved
  29. murchandamus commented at 7:23 pm on May 28, 2024: contributor
    Closed in favor of #1599
  30. murchandamus closed this on May 28, 2024


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 02:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me