Skip to content

PROJECT: Stand-Alone BIP-322 (Generic Signed Message Format Leveraging Bitcoin Script) CLI App #112

Open

Description

@ChristopherA

BIP-322 is a proposal originally by Kalle Alm (@kallewoof) to leverage the Bitcoin scripting language (ambiguously just called bitcoin script) to enable the signing of arbitrary messages using the same keys & scripts that Bitcoin uses for transactions.

In particular, BIP-322 extends the old single-key signing of messages (using the now off-by-default signmessage & verifymessage rpc api calls) which only worked with legacy scripts like Pay-to-Public-Key-Hash (P2PKH), to allow signing messages using any Bitcoin script wich can conceivably spend (in particular Pay-to-Witness-Script-Hash (P2WSH).

In older versions of bitcoin-core's bitcoind , this is the way the signmessage and verifymessage calls worked (example from LBTCftCL):

$ bitcoin-cli getnewaddress -addresstype legacy
moKVV6XEhfrBCE3QCYq6ppT7AaMF8KsZ1B
$ bitcoin-cli signmessage "moKVV6XEhfrBCE3QCYq6ppT7AaMF8KsZ1B" "Hello, World"
HyIP0nzdcH12aNbQ2s2rUxLwzG832HxiO1vt8S/jw+W4Ia29lw6hyyaqYOsliYdxne70C6SZ5Utma6QY/trHZBI=
$ bitcoin-cli verifymessage "moKVV6XEhfrBCE3QCYq6ppT7AaMF8KsZ1B" "HyIP0nzdcH12aNbQ2s2rUxLwzG832HxiO1vt8S/jw+W4Ia29lw6hyyaqYOsliYdxne70C6SZ5Utma6QY/trHZBI=" "Hello, World"
true

The goal of this project is to implement BIP-322 signmessage and verifymessage functions as a C++ Command Line Interface (CLI) app, in a form that allows for the offline signing of messages, with no dependencies on bitcoin-core's bitcoind server, but leveraging the more secure and supported bitcoin-core libraries like secp256k1 and likely btcdeb.

Community Project milestones:

  • Establish team channels
  • Schedule Intro call & agenda
    • OTHERS?
    • DECISION: Do we have sufficient critical mass of team members to tackle this project this summer (June-August 2022)?
  • Create initial repo (license, CLA, initial documents, uses cases, specs, issues, etc.)
    • Give team write access to repo
  • Write Use Cases
    • Initial use cases document at https://hackmd.io/KR5ALrSSQO6eyrnUBJreeA
    • Simple offline use case (sign using a secp256k1 private key)
    • Simple bitcoin use case (sign using an bitcoin address, either a spent transaction or is a UTXO)
    • Simple identity use case (#w3c did:key?)
    • Complex identity use case (#w3c did:btcr2?)
    • Use cases for variants such as P2WSH, P2TR, multisig and PSBT support.
    • Other use cases
  • Write Requirements for
    • Proof of Concept or MVP
      • POC/MVP requirements
      • Scope & timeframe
    • Future implementations thoughts (what are we leaving out of POC/MVP?)
  • Identify canonical test examples and testing criteria
  • Implement POC/MVP
    • Identify lead and assign roles
  • Document and publicize POC/MVP
  • Explore next steps
    • Post-mortem
      • Identify weaknesses of current implementation and low-hanging fruit as possible next steps.
      • How well did this project work out as a summer internship project? How can we do better?
    • Solicit support from Patrons & other funders for continued development

(This issue follows community discussion at #76 (comment) with @ChristopherA @kallewoof @deymow @shoryak @shikharvashistha @Eunoia172 @wip-abramson @ahmadi-08)

Activity

  1. wip-abramson commented on May 23, 2022

    @wip-abramson

    The P.R. you reference that adds BIP 322 to bitcoin core is out of date. I believe it was closed in favour of this one - bitcoin/bitcoin#24058.

  2. wip-abramson commented on Jun 2, 2022

    @wip-abramson

    Hey, any update on this project? When is it kicking off?

  3. ChristopherA commented on Jun 2, 2022

    @ChristopherA
    ContributorAuthor

    @wip-abramson we've been challenged trying to set up a meeting that works for Japan, California, and London. Doesn't seem to be working. Planning may be two meetings, one with @kallewoof and one with you. Is there a 9am meeting PDT hole in your schedule anytime soon?

  4. benthecarman commented on Jun 11, 2022

    @benthecarman

    Implementation in scala I created: bitcoin-s/bitcoin-s#3823

  5. ChristopherA commented on Jun 13, 2022

    @ChristopherA
    ContributorAuthor

    Last week with met in Zoom with @kallewoof. Let me know if you want the audio recording from that meeting.

    We are meeting tomorrow (Monday 9am PDT) with @wip-abramson. Contact me if you have not received Zoom details. I will record it as well.

  6. wip-abramson commented on Jun 13, 2022

    @wip-abramson

    If anyone could review this P.R. which is a WIP of bip322 in the buidl-python library - buidl-bitcoin/buidl-python#140

    That would be much appreciated!

  7. ChristopherA commented on Jun 13, 2022

    @ChristopherA
    ContributorAuthor

    We've begun to draft some use cases for BIP-322 at https://hackmd.io/KR5ALrSSQO6eyrnUBJreeA — please feel free to add more, or add comments (in the view interface) if you have constructive criticism. In particular, the "proof of reserve" use cases have had some active criticism in the past that we'd like to either capture or address.

    Our initial goal is to support requirements for our libraries and reference implementation for BIP-322, but I also want to publish this in some final form later this summer.

  8. ChristopherA commented on Aug 9, 2022

    @ChristopherA
    ContributorAuthor

    There is a thread starting today on Bitcoin-Lev list BIP-322: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-August/020844.html

  9. ZenulAbidin commented on Aug 13, 2022

    @ZenulAbidin

    There is a thread starting today on Bitcoin-Lev list BIP-322: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-August/020844.html

    I'm the author of that post - I also happen to be a C++11 dev. I am willing to help out with a standalone BIP322 C++ implementation.

  10. added
    program: lbtcftclassociated with the Learning Bitcoin from the Command Line projects
    program: gordianassociated with Gordian projects
    and removed
    program: lbtcftclassociated with the Learning Bitcoin from the Command Line projects
    on Oct 4, 2022
  11. moved this to 2023 Backlog in High Level Roadmapon Jan 16, 2023
  12. moved this from 2024 Q1 Backlog to 2024 Backlog in High Level Roadmapon Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    program: gordianassociated with Gordian projects

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions