Skip to content

Commit

Permalink
docs(bip-0046): add cert format and clarify expiry param
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni committed Jul 8, 2024
1 parent 0cdb745 commit b916ade
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bip-0046.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ To derive the address from the above calculated public key and timelock, we crea

In order to support signing of certificates, implementors should support signing ASCII messages.

The certificate message is defined as `"fidelity-bond-cert" || "|" || cert_pubkey || "|" || cert_expiry`.

The certificate expiry `cert_expiry` is the number of the 2016-block period after which the certificate is no longer valid. For example, if `cert_expiry` is 330 then the certificate will become invalid after block height 665280 (:=330x2016). The purpose of the expiry parameter is so that in case the certificate keypair is compromised, the attacker can only impersonate the fidelity bond for a limited amount of time.

A certificate message can be created by another application external to this standard. It is then prepended with the string `0x18 || "Bitcoin Signed Message:\n"` and a byte denoting the length of the certificate message. The whole thing is then signed with the private key of the <tt>derived_key</tt>. This part is identical to the "Sign Message" function which many wallets already implement.

Almost all wallets implementing this standard can use their already-existing "Sign Message" function to sign the certificate message. As the certificate message itself is always an ASCII string, the wallet may not need to specially implement this section at all but just rely on users copypasting their certificate message into the already-existing "Sign Message" user interface. This works as long as the wallet knows how to use the private key of the timelocked address for signing messages.
Expand Down

0 comments on commit b916ade

Please sign in to comment.