BlockchainCommons / BlockchainCommons/Community
PROJECT: Stand-Alone BIP-322 (Generic Signed Message Format Leveraging Bitcoin Script) CLI App
- Dominant language
- No language data
- Stars
- 68
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
[BIP-322](https://github.com/bitcoin/bips/blob/master/bip-0322.mediawiki) 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](https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line/blob/cd1ebf4174de57aea7a8031c3d1398490b451c6c/03_3_Setting_Up_Your_Wallet.md)):
```sh
$ 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](https://github.com/bitcoin-core)'s `bitcoind` server, but leveraging the more secure and supported bitcoin-core libraries like [secp256k1](http://github.com/bitcoin/secp256k1) and likely [btcdeb](https://github.com/kallewoof/btcdeb).
Community Project milestones:
- [ ] Establish team channels
- [x] This issue
- [x] Invite team
- [x] Summer interns
- [x] The larger Blockchain Commons community
- [x] Larger open development community
- [x] Via [Twitter](https://twitter.com/ChristopherA/status/1527738739329339393
- [ ] Get more RTS
- [ ] Initial letter to Bitcoin-Dev community
- [ ] Identify other key interested parties
- [x] Private channel on `Signal` (contact @ChristopherA for invite)
- [x] Schedule Intro call & agenda
- [x] Team intros
- [ ] Review spec & prior efforts
* [BIP-322](https://github.com/bitcoin/bips/blob/master/bip-0322.mediawiki)
* [BIP-322 PR (and comments) to `bitcoin-core`](https://github.com/bitcoin/bitcoin/pull/16440)
* [Bitcoin Script Debugger (btcdeb)](https://github.com/kallewoof/btcdeb)
* [Learning `btcdeb`](https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line/blame/master/09_3_Testing_a_Bitcoin_Script.md)
* [BIP-322 Python Script in Jupyter Notebook](https://github.com/LegReq/bip0322-signatures)
* 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 https://github.com/BlockchainCommons/Community/discussions/76#discussioncomment-2410593 with @christophera @kallewoof @deymow @shoryak @shikharvashistha @Eunoia172 @wip-abramson @ahmadi-08)
Contributor guide
Assessment
This issue has not been assessed yet.