# bc-cli Team Notes (aka "erector set" until we have a better name) # 2020-09-14 # Repos (in order of learning about arch) ## Misc. Topics * DHL S&T Prize for Digital Wallets * https://www.dhs.gov/science-and-technology/news/2020/09/08/news-release-st-new-prize-competition-user-interface-digital ## Core Proposals * [BCR-2020-005](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md): Uniform Resources (UR): Encoding Structured Binary Data for Transport in URIs and QR Codes * [BCR-2020-006](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-006-urtypes.md): Registry of Uniform Resource (UR) Types * [BCR-2020-007](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-007-hdkey.md): UR Type Definition for Hierarchical Deterministic (HD) Keys * [BCR-2020-008](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-008-eckey.md): UR Type Definition for Elliptic Curve (EC) Keys * [BCR-2020-009](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-009-address.md): UR Type Definition for Cryptocurrency Addresses * [BCR-2020-010](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-010-output-desc.md): UR Type Definition for Bitcoin Output Descriptors * [BCR-2020-011](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-011-sskr.md): UR Type Definition for Shamir Secret Key Recovery (SSKR)McNally * [BCR-2020-012](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-012-bytewords.md): Bytewords: Encoding binary data as English words ## Reference Code * [bc-crypto-base](https://github.com/blockchaincommons/bc-crypto-base): Well-Reviewed and Audited Cryptographic Functions * [bc-bip39](https://github.com/blockchaincommons/bc-bip39): Implementation of BIP-39 "Mnemonic code for generating deterministic keys" * [bc-shamir](https://github.com/blockchaincommons/bc-shamir): Implementation of Shamir Secret Sharing * [bc-sskr](https://github.com/blockchaincommons/bc-sskr): Implementation of Shamir Secret Key Recovery (SSKR) * [bc-bytewords](https://github.com/blockchaincommons/bc-bytewords): Bytewords is a method for encoding binary objects as a sequence of four-letter English words. bc-bytewords is a C implementation of a Bytewords codec. * [bc-ur](https://github.com/blockchaincommons/bc-ur): UR Reference Implementation in C++ * [foundation-ur-py](https://github.com/Foundation-Devices/foundation-ur-py): Foundation Devices' port of `bc-ur` to Python. * [URKit](https://github.com/blockchaincommons/URKit): An iOS framework for encoding and decoding URs (Uniform Resources) * [URDemo](https://github.com/blockchaincommons/URDemo): An app to demonstrate sending and receiving of URs using URKit * [LifeHash](https://github.com/blockchaincommons/LifeHash): A method of hash visualization based on Conway’s Game of Life that creates beautiful icons that are deterministic, yet distinct and unique given the input data. ## Tools * [Seedtool](https://github.com/BlockchainCommons/bc-seedtool-cli/): A command-line tool for creating and transforming cryptographic seeds of the sort commonly used by blockchain applications. * [Keytool](https://gist.github.com/wolfmcnally/b2f047c870c21868c82211c2102e5432): a CLI tool that implements a data flow graph for deriving cryptocurrency keys and addresses. * [Sigtool](https://gist.github.com/wolfmcnally/d1dc4618be4042713f65054f368e3c0f): a CLI tool that cryptographically signs and verifies messages using formats and algorithms used in cryptocurrency and blockchain development. ## Questions * What's the relationship between SeedTool (bc-seedtool-cli), bc-keytool-cli and HD-wallet related BIPs? * I've answered this at https://github.com/BlockchainCommons/AirgappedSigning/discussions/17 ## Next steps 1. Try Seedtool and understand the purpose of these referenced libraries. 2. Identify if we can leverage any of the BC libraries for the Git++ project, and make bindings for Javascript or Go if necessary. * What can be encoded as a UR in ZCAP? * For zcaps, they are json structures so probably are encoded a a single CBOR object in UR, like we do PSBTs. If we create our own directed capability authorization objects, they should be UR native for compactness. 3. Acquire the background knowledge for Sigtool. (I listed some terms mentioned today, and there might be more we have to learn.) - multisig - threshold multisig - aggregate signature - smart signature - adaptor signature * I'll work on some syllabii links * BIP 340 Schnorr Signatures for secp256k2 https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki * Sured Bits Blog: * Schnorr Signatures Introduction: https://suredbits.com/introduction-to-schnorr-signatures/ * Schnorr ID protocol part 1 : https://suredbits.com/schnorr-security-part-1-schnorr-id-protocol/ * Schnorr ID protocol part 2: https://suredbits.com/schnorr-security-part-2-from-id-to-signature/ * Schnorr MuSig: https://suredbits.com/schnorr-applications-musig/ * Schnorr Threshold Signatures: https://suredbits.com/schnorr-applications-threshold-signatures/ * Schnorr Adaoter Signatures & Scriptless Scripts https://suredbits.com/schnorr-applications-scriptless-scripts/ * Schnorr Batch Verification: https://suredbits.com/schnorr-applications-batch-verification/ * Schnorr VSS & Distributed Key Generation: https://suredbits.com/schnorr-applications-frost/ https://tlu.tarilabs.com/cryptography/scriptless-scripts/introduction-to-scriptless-scripts.html https://joinmarket.me/blog/blog/flipping-the-scriptless-script-on-schnorr/ http://diyhpl.us/wiki/transcripts/layer2-summit/2018/scriptless-scripts/ https://medium.com/@gertjaap/discreet-log-contracts-invisible-smart-contracts-on-the-bitcoin-blockchain-cc8afbdbf0db From an old email to Marcelo: The next step is to actually do our Schnorr operations. Poelstra wrote a library that does some useful ones at https://github.com/apoelstra/sighacker, but he does it from his own hack of secp and it doesn't work with x-only BIP-Schnorr. Initially simple signing is the most important, but signtocontract and some adaptor signature ideas are the ultimate direction we want to move to. https://tokyo2018.scalingbitcoin.org/files/Day2/workshop-on-scriptless-scripts.pdf The first thing I'd like to emulate is detached signatures like minisign https://github.com/jedisct1/minisign but with schnorr. It should be able to a minisign style output or do a JSON output. I'm not quite sure if (or how best) to do armored signatures, but suspect that https://saltpack.org/ has some ideas. I've attached some other ideas from Mark Friedenback on what this signing utility might look like. Longer term I'd like to puzzle how to leverage encryption and some capabilities ideas. I like what minilock https://45678.github.io/miniLock-file-format/2.html functionality offers but I think it can be done both Schnorr musig rather than only Schnorr singlesig, and I think there are benefits for group signing of minilock style files. There are also some good ideas in did:git https://github.com/dhuseby/did-git-spec/blob/master/did-git-spec.md — my thoughts are that fog-like encrypted data objects are somewhat like git repos but are only valid if the signatures of all the changes are valid. That is how write/update/append capabilities might function — they give you a musig signature that gives you the authority to sign a commit.