├── .gitignore
├── CLA-signed
└── README.md
├── CLA.md
├── CODEOWNERS
├── CONTRIBUTING.md
├── Docs
├── README.md
├── crypto-request-or-crypto-psbt.md
├── crypto-request-test-vectors.md
├── crypto-seed-test-vectors.md
├── key-derivations.md
├── sskr-cold-storage.md
├── sskr-developers.md
├── sskr-overview.md
├── sskr-test-vector.md
├── sskr-users.md
├── sskr-video.md
├── ur-1-overview.md
├── ur-2-keys.md
├── ur-3-sskrs.md
├── ur-4-psbt.md
├── ur-99-request-response.md
├── ur-envelope-request.md
└── ur-overview.md
├── LICENSE
├── README.md
├── dcbor.md
└── images
├── README.md
├── khaki-300.jpg
├── logos
├── README.md
├── crypto-commons-logo.ai
├── crypto-commons-logo.jpg
├── crypto-commons-logo.png
├── crypto-commons-logo.psd
├── crypto-commons-screen.jpg
├── crypto-commons-screen.png
├── crypto-commons-screen.psd
├── crypto-commons-simple.ai
├── crypto-commons-simple.png
├── crypto-commons-super-simple copy.ai
├── crypto-commons-super-simple.png
├── crypto-commons.ai
└── crypto-commons.png
├── sskr-group-1.jpeg
├── sskr-group-2.jpeg
├── sskr-import.jpeg
├── sskr-seed-256.jpg
├── sskr-seed.png
├── sskr-shares-1.png
├── sskr-shares-2.png
├── sskr-shares-256-1.jpg
├── sskr-shares-256-2.jpg
├── sskr-shares-256-3.jpg
├── sskr-shares-3.png
├── sskr-single-1.jpeg
├── sskr-single-2.jpeg
├── vectors
├── README.md
├── ffa11a8-Yinmn-Blue-Puff-Seed-UR.jpeg
├── ffa11a8-Yinmn-Blue-Puff-Seed-UR.png
├── vector-master-private-comment.png
├── vector-master-private.png
├── vector-master-public-comment.png
├── vector-master-public.png
├── vector-request-khaki.png
├── vector-request-yinmn-note.png
├── vector-request-yinmn.png
├── vector-seed-khaki-date.png
├── vector-seed-khaki-lnote.png
├── vector-seed-khaki-name.png
├── vector-seed-khaki-note.png
├── vector-seed-khaki.png
├── vector-seed-yinmn-date.png
├── vector-seed-yinmn-lnote.png
├── vector-seed-yinmn-name.png
├── vector-seed-yinmn-note.png
├── vector-seed-yinmn.png
├── vector-segwit-cosigner-private-comment.png
├── vector-segwit-cosigner-private.png
├── vector-segwit-cosigner-public-comment.png
├── vector-segwit-cosigner-public.png
├── vector-segwit-single-private-comment.png
├── vector-segwit-single-private.png
├── vector-segwit-single-public-comment.png
└── vector-segwit-single-public.png
├── video-tech-overview.png
└── yinmn-blue-300.jpg
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io/api/macos
2 |
3 | ### macOS ###
4 | # General
5 | .DS_Store
6 | .AppleDouble
7 | .LSOverride
8 |
9 | # Icon must end with two \r
10 | Icon
11 |
12 | # Thumbnails
13 | ._*
14 |
15 | # Files that might appear in the root of a volume
16 | .DocumentRevisions-V100
17 | .fseventsd
18 | .Spotlight-V100
19 | .TemporaryItems
20 | .Trashes
21 | .VolumeIcon.icns
22 | .com.apple.timemachine.donotpresent
23 |
24 | # Directories potentially created on remote AFP share
25 | .AppleDB
26 | .AppleDesktop
27 | Network Trash Folder
28 | Temporary Items
29 | .apdisk
30 |
31 | # End of https://www.gitignore.io/api/macos
32 |
33 | # Created by https://www.gitignore.io/api/c
34 |
35 | ### C ###
36 | # Prerequisites
37 | *.d
38 |
39 | # Object files
40 | *.o
41 | *.ko
42 | *.obj
43 | *.elf
44 |
45 | # Linker output
46 | *.ilk
47 | *.map
48 | *.exp
49 |
50 | # Precompiled Headers
51 | *.gch
52 | *.pch
53 |
54 | # Libraries
55 | *.lib
56 | *.a
57 | *.la
58 | *.lo
59 |
60 | # Shared objects (inc. Windows DLLs)
61 | *.dll
62 | *.so
63 | *.so.*
64 | *.dylib
65 |
66 | # Executables
67 | *.exe
68 | *.out
69 | *.app
70 | *.i*86
71 | *.x86_64
72 | *.hex
73 |
74 | # Debug files
75 | *.dSYM/
76 | *.su
77 | *.idb
78 | *.pdb
79 |
80 | # Kernel Module Compile Results
81 | *.mod*
82 | *.cmd
83 | .tmp_versions/
84 | modules.order
85 | Module.symvers
86 | Mkfile.old
87 | dkms.conf
88 |
89 | # End of https://www.gitignore.io/api/c
90 |
--------------------------------------------------------------------------------
/CLA-signed/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/CLA-signed/README.md
--------------------------------------------------------------------------------
/CLA.md:
--------------------------------------------------------------------------------
1 | # Contributor License Agreement
2 |
3 | Version 1.0
4 |
5 | Name: `$name`
6 |
7 | E-Mail: `$email`
8 |
9 | Legal Jurisdiction: Wyoming, United States of America
10 |
11 | Project: https://github.com/BlockchainCommons/bc-lethe-kit
12 |
13 | Date: `$date`
14 |
15 | ## Purpose
16 |
17 | This agreement gives Blockchain Commons, LLC the permission it needs in order to accept my contributions into its open software project and to manage the intellectual property in that project over time.
18 |
19 | ## License
20 |
21 | I hereby license Blockchain Commons, LLC to:
22 |
23 | 1. do anything with my contributions that would otherwise infringe my copyright in them
24 |
25 | 2. do anything with my contributions that would otherwise infringe patents that I can or become able to license
26 |
27 | 3. sublicense these rights to others on any terms they like
28 |
29 | ## Reliability
30 |
31 | I understand that Blockchain Commons will rely on this license. I may not revoke this license.
32 |
33 | ## Awareness
34 |
35 | I promise that I am familiar with legal rules, like ["work made for hire" rules](http://worksmadeforhire.com), that can give employers and clients ownership of intellectual property in work that I do. I am also aware that legal agreements I might sign, like confidential information and invention assignment agreements, will usually give ownership of intellectual property in my work to employers, clients, and companies that I found. If someone else owns intellectual property in my work, I need their permission to license it.
36 |
37 | ## Copyright Guarantee
38 |
39 | I promise not to offer contributions to the project that contain copyrighted work that I do not have legally binding permission to contribute under these terms. When I offer a contribution with permission, I promise to document in the contribution who owns copyright in what work, and how they gave permission to contribute it. If I later become aware that one of my contributions may have copyrighted work of others that I did not have permission to contribute, I will notify Blockchain Commons, in confidence, immediately.
40 |
41 | ## Patent Guarantee
42 |
43 | I promise not to offer contributions to the project that I know infringe patents of others that I do not have permission to contribute under these terms.
44 |
45 | ## Open Source Guarantee
46 |
47 | I promise not to offer contributions that contain or depend on the work of others, unless that work is available under a license that [Blue Oak Council rates bronze or better](https://blueoakconcil.org/list), such as the MIT License, two- or three-clause BSD License, the Apache License Version 2.0, or the Blue Oak Model License 1.0.0. When I offer a contribution containing or depending on others' work, I promise to document in the contribution who licenses that work, along with copies of their license terms.
48 |
49 | ## Disclaimers
50 |
51 | ***As far as the law allows, my contributions come as is, without any warranty or condition. Other than under [Copyright Guarantee](#copyright-guarantee), [Patent Guarantee](#patent-guarantee), or [Open Source Guarantee](#open-source-guarantee), I will not be liable to anyone for any damages related to my contributions or this contributor license agreement, under any kind of legal claim.***
52 |
53 | ---
54 |
55 | To sign this Contributor License Agreement, fill in `$name`, `$email`, and `$date` above. Then sign using GPG using the following command `gpg --armor --clearsign --output ./CLA-signed/CLA.YOURGITHUBNAME.YOURGPGFINGERPRINT.asc CLA.md`, then either submit your signed Contributor License Agreement to this repo as a GPG signed Pull Request or email it to [ChristopherA@BlockchainCommons.com](mailto:ChristopherA@BlockchainCommons.com).
56 |
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # These owners will be the default owners for everything in this repo.
2 |
3 | * @ChristopherA
4 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
4 |
5 | - Reporting a bug
6 | - Discussing the current state of the code
7 | - Submitting a fix
8 | - Proposing new features
9 | - Becoming a maintainer
10 |
11 | ## We Develop with Github
12 | We use GitHub to host code, to track issues and feature requests, and to accept Pull Requests.
13 |
14 | ## Report Bugs using Github's [issues](https://github.com/briandk/transcriptase-atom/issues)
15 |
16 | If you find bugs, mistakes, or inconsistencies in this project's code or documents, please let us know by [opening a new issue](./issues), but consider searching through existing issues first to check and see if the problem has already been reported. If it has, it never hurts to add a quick "+1" or "I have this problem too". This helps prioritize the most common problems and requests.
17 |
18 | ### Write Bug Reports with Detail, Background, and Sample Code
19 |
20 | [This is an example](http://stackoverflow.com/q/12488905/180626) of a good bug report by @briandk. Here's [another example from craig.hockenberry](http://www.openradar.me/11905408).
21 |
22 | **Great Bug Reports** tend to have:
23 |
24 | - A quick summary and/or background
25 | - Steps to reproduce
26 | - Be specific!
27 | - Give sample code if you can. [The stackoverflow bug report](http://stackoverflow.com/q/12488905/180626) includes sample code that *anyone* with a base R setup can run to reproduce what I was seeing
28 | - What you expected would happen
29 | - What actually happens
30 | - Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
31 |
32 | People *love* thorough bug reports. I'm not even kidding.
33 |
34 | ## Submit Code Changes through Pull Requests
35 |
36 | Simple Pull Requests to fix typos, to document, or to fix small bugs are always welcome.
37 |
38 | We ask that more significant improvements to the project be first proposed before anybody starts to code as an [issue](./issues) or as a [draft Pull Request](./pulls), which is a [nice new feature](https://github.blog/2019-02-14-introducing-draft-pull-requests/) that gives other contributors a chance to point you in the right direction, give feedback on the design, and maybe discuss if related work is already under way.
39 |
40 | ### Use a Consistent Coding Style
41 |
42 | * We indent using two spaces (soft tabs)
43 | * We ALWAYS put spaces after list items and method parameters ([1, 2, 3], not [1,2,3]), around operators (x += 1, not x+=1), and around hash arrows.
44 | * This is open-source software. Consider the people who will read your code, and make it look nice for them. It's sort of like driving a car: Perhaps you love doing donuts when you're alone, but with passengers the goal is to make the ride as smooth as possible.
45 |
46 | ### Use [Github Flow](https://guides.github.com/introduction/flow/index.html) for Pull Requests
47 |
48 | We use [Github Flow](https://guides.github.com/introduction/flow/index.html). When you submit Pull Requests, please:
49 |
50 | 1. Fork the repo and create your branch from `master`.
51 | 2. If you've added code that should be tested, add tests.
52 | 3. If you've changed APIs, update the documentation.
53 | 4. Ensure the test suite passes.
54 | 5. Make sure your code lints.
55 | 6. Issue that Pull Request!
56 |
57 | ### Submit Under the BSD-2-Clause Plus Patent License
58 |
59 | In short, when you submit code changes, your submissions are understood to be available under the same [BSD-2-Clause Plus Patent License](./LICENSE.md) that covers the project. We also ask all code contributors to GPG sign the [Contributor License Agreement (CLA.md)](./CLA.md) to protect future users of this project. Feel free to contact the maintainers if that's a concern.
60 |
61 | ## References
62 |
63 | Portions of this CONTRIBUTING.md document were adopted from best practices of a number of open source projects, including:
64 | * [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
65 | * [IPFS Contributing](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
66 |
--------------------------------------------------------------------------------
/Docs/README.md:
--------------------------------------------------------------------------------
1 | # Documents
2 |
3 | Blockchain Commons has produced a variety of documentation of interest to developers and users of blockchains.
4 |
5 | ## The Crypto Commons
6 |
7 | Our crypto-commons specifications, reference tools, and libraries offer new interoperable methodologies for cryptocurrency wallets, and may be of interest to developers and users.
8 |
9 | ### General
10 |
11 | 1. [Key Derivation Names](key-derivations.md)
12 |
13 | ### Sharded Secret Key Reconstruction (SSKR)
14 |
15 | SSKRs allow a seed to be sharded into shares that can be stored as words, URs, or QRs.
16 |
17 | 1. [SSKR for Users](sskr-users.md)
18 | * [SSKR Cold Storage](sskr-cold-storage.md)
19 | * [SSKR Video Example](sskr-video.md)
20 | 1. [SSKR for Developers](sskr-developers.md)
21 | * [SSKR Test Vector](sskr-test-vector.md)
22 |
23 | _For an even more comprehensive list, please see our [SSKR overview page](sskr-overview.md), which includes links to research papers, references, code, and other material from other repos, all intended to support your understanding of SSKR, whether you're a user, a power user, or a developer._
24 |
25 | ### Uniform Resources (URs)
26 |
27 | URs allow for the interoperable transmission and storage of a variety of information, especially cryptographic data.
28 |
29 | 1. [URs: An Introduction](ur-1-overview.md)
30 | * [A Guide to Using URs for PSBTs](ur-4-psbt.md)
31 | * [A Guide to Using URs for Key Material](ur-2-keys.md)
32 | * [A Guide to Using URs for SSKRs](ur-3-sskrs.md)
33 | * [A Guide to Using UR Request & Response](ur-99-request-response.md) [**Deprecated**]
34 | 1. [crypto-request and crypto-response vs Signing via crypto-psbt](crypto-request-or-crypto-psbt.md)
35 | 1. [ur:crypto-request test vectors](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/crypto-request-test-vectors.md)
36 | 1. [ur:crypto-seed test vectors](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/crypto-seed-test-vectors.md)
37 |
38 | One of the important aspects of URs was that they allowed for the introduction of Animated QRs:
39 |
40 | 1. [Animated QRs](https://www.blockchaincommons.com/devs/animated-qrs.html)
41 | 1. [Animated QRs Video](https://www.youtube.com/watch?v=HsFF5HPKQIk)
42 |
43 | _We also have a more comprehensive [UR overview page](ur-overview.md) that includes links to research papers, references, code, and other material of interest primarily to UR developers._
44 |
45 | ### Technology Overview Video
46 |
47 |
48 |
49 | ### Coming Soon
50 |
51 | _We are planning one more UR article in the near future, detailing how to use URs with PSBTs._
52 |
53 | _Please feel free to file an issue if there's more Crypto Commons specifications that you'd like to see with more extensive documents._
54 |
55 | ## #SmartCustody
56 |
57 | #SmartCustody is an initiative meant to help users to safely manage their cryptocurrency and is focused on responsible key management.
58 |
59 | 1. [SmartCustody Book 1.01](https://www.smartcustody.com/)
60 | 1. [Designing Multisig for Independence & Resilience](https://github.com/BlockchainCommons/SmartCustody/blob/master/README.md#the-smartcustody-book)
61 | 1. [Using Timelocks to Protect Digital Assets](https://github.com/BlockchainCommons/SmartCustody/blob/master/Docs/Timelocks.md)
62 | 1. [Designing SSKR Share Scenarios](https://github.com/BlockchainCommons/SmartCustody/blob/master/Docs/SSKR-Sharing.md)
63 | 1. [The Dangers of Secret-Sharing Schemes](https://github.com/BlockchainCommons/SmartCustody/blob/master/Docs/SSKR-Dangers.md)
64 |
65 | See [the SmartCustody repo](https://github.com/BlockchainCommons/SmartCustody/blob/master/README.md#the-smartcustody-book) for the most up-to-date listing of docs.
66 |
67 | ## Learning Bitcoin from the Command Line
68 |
69 | Learning Bitcoin is our classic course that introduce Bitcoin concepts and programming beginning with Bitcoin Core's command-line tools and its RPC interface.
70 |
71 | 1. [Learning Bitcoin from the Command Line 2.0](https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line/blob/master/README.md)
72 |
--------------------------------------------------------------------------------
/Docs/crypto-request-or-crypto-psbt.md:
--------------------------------------------------------------------------------
1 | # `crypto-request` and `crypto-response` vs Signing via `crypto-psbt`
2 |
3 | ## by Wolf McNally, Christopher Allen, and Shannon Applecline for Blockchain Commons
4 |
5 | ### Introduction
6 |
7 | The Blockchain Commons [Uniform Resource (UR)](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md) technology is designed to make it easy to transmit structured binary data via several methods, including text and QR codes. It addresses the inherent size limits of QR codes by supporting streaming message fragments using fountain codes.
8 |
9 | Blockchain Commons, in cooperation with members of the [airgapped wallet community](https://github.com/BlockchainCommons/Airgapped-Wallet-Community/discussions), has expanded URs by developing a proposed standard for a UR-based message architecture that can be used as a standard design pattern to request various actions from network-isolated devices (`crypto-request`), and for those devices to respond to those requests (`crypto-response`).
10 |
11 | For the purpose of signing [Partially Signed Bitcoin Transactions (PSBTs)](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki), some developers have chosen to use a bare UR-encoded PSBT (`crypto-psbt`) as a way to request a signature instead of using `crypto-request` and `crypto-response`. This approach, while straightforward, has a number of distinct disadvantages over the request-response pattern that Blockchain Commons has proposed. The purpose of this document is to explain the motivation for the request-response architecture, in order to encourage its universal adoption by the airgapped wallet community.
12 |
13 | ### The Purpose and Limits of PSBTs
14 |
15 | As a tool for handing structured data, each top-level UR has a type. The bare UR-encoded `crypto-psbt`, which represents a single PSBT, is one of those. The intention with PSBTs is that they be generated by one party, and then passed around to one or more other parties for co-signing. The co-signed PSBTs are then passed to another party (which could be the originating party) who finalizes the transaction and produces a fully-signed transaction ready to be transmitted to the Bitcoin network.
16 |
17 | The PSBT specification allows for the inclusion of additional metadata about the transaction such as the identity and derivation paths of the [BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) HD keys that must be used to sign the transaction's inputs. PSBTs can also contain user-specified data, but this usage can become problematic if a user attempts to convey complex policies that PSBTs themselves were never designed to handle, such as the creator of the transaction, the intention for the transaction's use, the business rules that are being enforced or that must be enforced by the co-signers, or the motivation that signers should have to actually sign the transaction.
18 |
19 | PSBTs were never meant to convey general business rules of this sort: they are not a mechanism of coordination between parties. Instead, in order to convey higher-level communications between parties, a PSBT may need to be used in conjunction with other structures. That's where the `crypto-request` and `crypto-response` URs come in.
20 |
21 | ### The Need for Higher-Level Conversations
22 |
23 | Any UR type that can be conveyed as a top-level UR (such as `crypto-psbt`) can also be embedded as a CBOR object within a larger object (such as `crypto-request` or `crypto-response`). While Blockchain Commons produced the spec for a `crypto-psbt` type, which presents only a raw PSBT, we also recognized the need to more generally facilitate higher-level conversations between participants. The `crypto-psbt` spec does nothing more than present a transaction that may or may not have some of its inputs signed; it does not carry any semantics about what the recipient should actually *do* with the transaction it receives. While the recipient of a PSBT might assume that its mere receipt implies a request to sign the transaction, we can easily imagine scenarios where the intent of transmitting a PSBT is *not* for it to be signed, but for it to be stored for later retrieval, relayed to another party, validated against some set of business rules, or finalized and transmitted to the network.
24 |
25 | Therefore as a best practice, requests for actions should be explicit between participants. This is similar in nature to other established protocols like HTTP, where a request consists of a both verb and a noun, e.g., `GET https://blockchaincommons.com`. A URL by itself is just a pointer, and as such is ambiguous. PSBTs are similar: by itself, a PSBT is *not* actually a request to sign a transaction; it is merely a transaction in a possibly unsigned and unfinalized state.
26 |
27 | ### The Request-Response Architecture
28 |
29 | This need for clarity was the motivation for Blockchain Commons to create the `crypto-request` and `crypto-response` specifications. These URs are messages designed to facilitate participants' understanding of what they are being asked to do, in workflows that vary in complexity.
30 |
31 | **NOTE:** To avoid terminology confusion with PSBTs and finalized Bitcoin "transactions", in the present document we will resist the urge to call the sending of requests and receiving of responses "transactions between the parties" and shall instead simply refer to them as requests and responses.
32 |
33 | The initial specification for `crypto-request` and `crypto-response` supports three scenarios:
34 |
35 | 1. The requester provides a seed digest, and wishes the responder to reply with the corresponding `crypto-seed`.
36 | 2. The requester provides an HD key fingerprint, derivation path, and type of desired key (private or public), and wishes the responder to reply with the corresponding derived HD key. The fingerprint may also be omitted, in which case the respondant can choose the seed or key from which to perform the specified derivation.
37 | 3. The requester provides a `crypto-psbt`, and wishes the responder to reply with another `crypto-psbt` containing as many output signatures as it can perform.
38 |
39 | The `crypto-request` CBOR object is [currently defined](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2021-001-request.md#cddl-for-request) as follows:
40 |
41 | ```
42 | crypto-request = {
43 | transaction-id: uuid,
44 | body: request-seed / request-hdkey-derivation / request-psbt-signature,
45 | ? description: text ; Text to be displayed to the approving user.
46 | }
47 | ```
48 |
49 | The `crypto-request` structure includes a `transaction-id` field and an optional `description` field. Fields at this level are intended to help facilitate all sorts of requests.
50 |
51 | The purpose of the `transaction-id` is so that transaction producer/coordinators can receive responses to their requests and know that these responses have been generated specifically to service their particular requests, and are not responses to some other request. In general, the sender of a request must not accept a response that does not contain the same `transaction-id` as the one in the request. This may not be necessary for simple, relatively stateless interactions, but could be crucial for more complex ones.
52 |
53 | The purpose of the optional `description` field is to provide an advisory to the human user receiving the request as to its meaning or purpose.
54 |
55 | In the case of a request for a PSBT signature, the `body` field is defined as follows:
56 |
57 | ```
58 | ;
59 | ; Returns the given PSBT with one or more outputs signed.
60 | ;
61 | request-psbt-signature = #6.502({
62 | psbt: crypto-psbt
63 | })
64 | ```
65 |
66 | As you can see, the `body` of a `crypto-request` is an enumerated type that expresses the nature of the request (e.g., "sign this psbt") and the data needed to perform the action (e.g., the PSBT itself). Because this information is being conveyed as structured CBOR data, it also inheres the possibility for future extension: both in the kind of actions that can be requested, and in what data is included as parameters for particular requests.
67 |
68 | The higher-level `crypto-request` structure may thus be extended with other alternatives for the `body` field, and the nested `request-psbt-signature` structure may be extended with additional fields that specify, for example, additional validations to be performed or additional business rules to be enforced. Extending the existing structures would involve identifying use-case scenarios that the community would find useful, specifying additional fields and/or semantics to be added to the existing specifications, and updating reference implementations to support those extensions, including ensuring backward compatibility.
69 |
70 | ### The Future
71 |
72 | Given the structured nature of CBOR, future request types could even contain sub-requests of their own, enabling multi-level scenarios. The simplest practical use of this capability would be to specify an extension to `crypto-request` that supports the ability to encapsulate several sub-requests to be performed by the receiver and returned in a single `crypto-response`.
73 |
74 | The purpose for this generality is so that Blockchain Commons can work with the larger community to build the extensions needed to work with emergent scenarios, and to standardize on solutions that meet the greatest shared needs. Please consider how this general design pattern might fulfill your own needs for higher-level communications associated with Bitcoin transactions, and talk to us about how the design pattern might best be utilized for your purposes.
75 |
76 | ### The Need to Adopt Now
77 |
78 | Taken together, `crypto-request` and `crypto-response` provide a powerful general architecture for facilitating multi-party, multi-way conversations. It was never the intent of Blockchain Commons that `crypto-psbt` was to be used a signing request, but rather as a more general component in larger scenarios. The present particular need for requesting signatures on PSBTs and returning signed PSBTs is a use-case for early adoption of the request-response framework in the airgapped wallet community. It can and will be extended. Blockchain Commons strongly recommends that airgapped wallet providers support `crypto-request` and `crypto-response` out of the box, and not rely on more ambiguous and less future-proof methods.
79 |
--------------------------------------------------------------------------------
/Docs/crypto-request-test-vectors.md:
--------------------------------------------------------------------------------
1 | # `crypto-request` Test Vectors
2 |
3 | _**Deprecated.** crypto-requests are being replaced with Envelopes in newer reference apps._
4 |
5 | ## `crypto-hdkey` Requests
6 |
7 | ### Requests for Key Derivations from Any Seed
8 |
9 | When requesting a specific HD key derivation from a user-selected seed (tag 501), the body of the `crypto-request` has two elements of note: whether the key is private (1) and what the derivation path is (2).
10 | ```
11 | 2: 501({
12 | 1: false,
13 | 2: 304({
14 | 1: [84, true, 0, true, 0, true]
15 | })
16 | })
17 | ```
18 | The above requests a public key from `84'/0'/0'` (the Segwith single-sig derivation).
19 |
20 | #### Cosigner (`48'/0'/0'/2'`) Public Key
21 |
22 | 
23 |
24 | _AKA Segwit Multsig Public Key_
25 |
26 | ```
27 | {
28 | 1: 37(h'36ED0A7280A04AF98C8030F39871B6EA'),
29 | 2: 501({
30 | 1: false,
31 | 2: 304({
32 | 1: [48, true, 0, true, 0, true, 2, true]
33 | })
34 | })
35 | }
36 | ```
37 |
38 | ```
39 | ur:crypto-request/oeadtpdagdenwebkjplanbgeytlkladywfmkjsrpwdaotaadykoeadwkaotaaddyoyadlocsdyykaeykaeykaoykynurjomh
40 | ```
41 |
42 | #### Cosigner (`48'/0'/0'/2'`) Private Key
43 |
44 | 
45 |
46 | _AKA Segwit Multsig Private Key_
47 |
48 | ```
49 | {
50 | 1: 37(h'36ED0A7280A04AF98C8030F39871B6EA'),
51 | 2: 501({
52 | 1: true,
53 | 2: 304({
54 | 1: [48, true, 0, true, 0, true, 2, true]
55 | })
56 | })
57 | }
58 | ```
59 |
60 | ```
61 | ur:crypto-request/oeadtpdagdenwebkjplanbgeytlkladywfmkjsrpwdaotaadykoeadykaotaaddyoyadlocsdyykaeykaeykaoykjskkrkte
62 | ```
63 |
64 | #### Master Public Key
65 |
66 | 
67 |
68 | ```
69 | {
70 | 1: 37(h'36ED0A7280A04AF98C8030F39871B6EA'),
71 | 2: 501({
72 | 1: false,
73 | 2: 304({
74 | 1: []
75 | })
76 | })
77 | }
78 | ```
79 |
80 | ```
81 | ur:crypto-request/oeadtpdagdenwebkjplanbgeytlkladywfmkjsrpwdaotaadykoeadwkaotaaddyoyadlavdhfhnhp
82 | ```
83 |
84 | #### Master Private Key
85 |
86 | 
87 |
88 |
89 | ```
90 | {
91 | 1: 37(h'36ED0A7280A04AF98C8030F39871B6EA'),
92 | 2: 501({
93 | 1: true,
94 | 2: 304({
95 | 1: []
96 | })
97 | })
98 | }
99 | ```
100 |
101 | ```
102 | ur:crypto-request/oeadtpdagdynlremcyyttdfehdnsctctlomnstrlotaotaadykoeadwkaotaaddyoyadlncsghykaeykaeykaeuolywf
103 | ```
104 |
105 | #### Segwit Single Sig (`84'/0'/0'`) Public Key
106 |
107 | 
108 |
109 | ```
110 | {
111 | 1: 37(h'f684371af9d245589c1f1f888ec7b7a3'),
112 | 2: 501({
113 | 1: false,
114 | 2: 304({
115 | 1: [84, true, 0, true, 0, true]
116 | })
117 | })
118 | }
119 | ```
120 |
121 | ```
122 | ur:crypto-request/oeadtpdagdynlremcyyttdfehdnsctctlomnstrlotaotaadykoeadwkaotaaddyoyadlncsghykaeykaeykaeuolywf
123 | ```
124 |
125 | #### Segwit Single Sig (`84'/0'/0'`) Private Key
126 |
127 | 
128 |
129 | ```
130 | {
131 | 1: 37(h'36ED0A7280A04AF98C8030F39871B6EA'),
132 | 2: 501({
133 | 1: true,
134 | 2: 304({
135 | 1: [84, true, 0, true, 0, true]
136 | })
137 | })
138 | }
139 | ```
140 |
141 | ```
142 | ur:crypto-request/oeadtpdagdenwebkjplanbgeytlkladywfmkjsrpwdaotaadykoeadykaotaaddyoyadlncsghykaeykaeykbkatbncl
143 | ```
144 |
145 | ### Requests for Key Derivations from Any Seed with Comment
146 |
147 | Adding a comment to a request for a general key derivation simply requires adding a description, which is element 3 of the `crypto-request`. It should be displayed by the recipient, but it should not be used in any response
148 | ```
149 | 3: "Watch-only key to create ACME Multisig."
150 | ```
151 | The above adds the listed comment to a `crypto-request`.
152 |
153 | Reviewing a comment can help a user to determine if a request is clearly legitimate (or clearly fradulent).
154 |
155 | #### Cosigner (`48'/0'/0'/2'`) Public Key
156 |
157 | 
158 |
159 | _AKA Segwit Multsig Public Key_
160 |
161 | ```
162 | {
163 | 1: 37(h'F94ADE8D3843486180CC9B4D37F70724'),
164 | 2: 501({
165 | 1: false,
166 | 2: 304({
167 | 1: [48, true, 0, true, 0, true, 2, true]
168 | })
169 | }),
170 | 3: "Watch-only key to create ACME Multisig."
171 | }
172 | ```
173 |
174 | ```
175 | ur:crypto-request/otadtpdagdytgeuelgetfxfdhslasfndgtemylatdkaotaadykoeadwkaotaaddyoyadlocsdyykaeykaeykaoykaxksdihghsjyiaisdpjljtjzkkcxjeihkkcxjyjlcxiajpihhsjyihcxfpfxgtfecxgtkpjzjyinjkiniodmtddydeiy
176 | ```
177 |
178 | #### Cosigner (`48'/0'/0'/2'`) Private Key
179 |
180 | 
181 |
182 | _AKA Segwit Multsig Private Key_
183 |
184 | ```
185 | {
186 | 1: 37(h'03B0CB4C54C143E89E6D137FC56C41D6'),
187 | 2: 501({
188 | 1: true,
189 | 2: 304({
190 | 1: [48, true, 0, true, 0, true, 2, true]
191 | })
192 | }),
193 | 3: "Please give over private key for usage in real multisig."
194 | }
195 | ```
196 | ```
197 | ur:crypto-request/otadtpdagdaxpfsbgsghsefxvsnnjnbwlbskjzfptbaotaadykoeadykaotaaddyoyadlocsdyykaeykaeykaoykaxksetgdjzihhsjkihcxioinkoihcxjlkoihjpcxjojpinkohsjyihcxjeihkkcxiyjljpcxkpjkhsioihcxinjtcxjpihhsjzcxjnkpjzjyinjkiniodmasgefpwf
198 | ```
199 |
200 | #### Master Public Key
201 |
202 | 
203 |
204 | ```
205 | {
206 | 1: 37(h'84D22FD40EA74968993B9BDCF2CC00F3'),
207 | 2: 501({
208 | 1: false,
209 | 2: 304({
210 | 1: []
211 | })
212 | }),
213 | 3: "Master public key for watch-only wallet on Sparrow."
214 | }
215 | ```
216 |
217 | ```
218 | ur:crypto-request/otadtpdagdlrtddltybaosgaisnlfrnduowzsfaewfaotaadykoeadwkaotaaddyoyadlaaxkseogthsjkjyihjpcxjokpidjziniacxjeihkkcxiyjljpcxkthsjyiaisdpjljtjzkkcxkthsjzjzihjycxjljtcxgujohsjpjpjlktdmbgfrdaon
219 | ```
220 |
221 | #### Master Private Key
222 |
223 | 
224 |
225 |
226 | ```
227 | {
228 | 1: 37(h'389C3AA302C14088B21D4425B77B6450'),
229 | 2: 501({
230 | 1: true,
231 | 2: 304({
232 | 1: []
233 | })
234 | }),
235 | 3: "Transfer master key to Electrum for online usage."
236 | }
237 | ```
238 |
239 | ```
240 | ur:crypto-request/otadtpdagdetnsftotaosefzloprcafydarlkgiegdaotaadykoeadykaotaaddyoyadlaaxksehghjphsjtjkiyihjpcxjnhsjkjyihjpcxjeihkkcxjyjlcxfejzihiajyjpkpjncxiyjljpcxjljtjzinjtihcxkpjkhsioihdmkiaamows
241 | ```
242 | #### Segwit Single Sig (`84'/0'/0'`) Public Key
243 |
244 | 
245 |
246 | ```
247 | {
248 | 1: 37(h'601FDC4EE38841898D6DA3CEF9E855CE'),
249 | 2: 501({
250 | 1: false,
251 | 2: 304({
252 | 1: [84, true, 0, true, 0, true]
253 | })
254 | }),
255 | 3: "Creating single-sig watch-only wallet on Sparrow."
256 | }
257 | ```
258 | ```
259 | ur:crypto-request/otadtpdagdhnctuoglvllofpldlgjnottoytvsgotoaotaadykoeadwkaotaaddyoyadlncsghykaeykaeykaxksehfxjpihhsjyinjtiocxjkinjtiojzihdpjkiniocxkthsjyiaisdpjljtjzkkcxkthsjzjzihjycxjljtcxgujohsjpjpjlktdmjyskeshk
260 | ```
261 |
262 | #### Segwit Single Sig (`84'/0'/0'`) Private Key
263 |
264 | 
265 |
266 | ```
267 | {
268 | 1: 37(h'5C99BB444C354B659D58BC2299C47032'),
269 | 2: 501({
270 | 1: true,
271 | 2: 304({
272 | 1: [84, true, 0, true, 0, true]
273 | })
274 | }),
275 | 3: "We are withholding your arrest for one more day. This is your last chance to prove your identity by sending your private key. Police sherriffs will be on their way otherwise. Do naught delay!"
276 | }
277 | ```
278 |
279 | ```
280 | ur:crypto-request/otadtpdagdhhnlrkfygsecgrihnthdrfcpnlssjoeyaotaadykoeadykaotaaddyoyadlncsghykaeykaeykaxksrshgihcxhsjpihcxktinjyisisjljzieinjtiocxkkjlkpjpcxhsjpjpihjkjycxiyjljpcxjljtihcxjnjljpihcxiehskkdmcxghisinjkcxinjkcxkkjlkpjpcxjzhsjkjycxiaishsjtiaihcxjyjlcxjojpjlkoihcxkkjlkpjpcxinieihjtjyinjykkcxidkkcxjkihjtieinjtiocxkkjlkpjpcxjojpinkohsjyihcxjeihkkdmcxgdjljziniaihcxjkisihjpjpiniyiyjkcxktinjzjzcxidihcxjljtcxjyisihinjpcxkthskkcxjljyisihjpktinjkihdmcxfyjlcxjthskpioisjycxieihjzhskkclleskzohd
281 | ```
282 |
283 | ## `crypto-seed` Requests
284 |
285 | ### Sample Seed: Yinmn Blue
286 |
287 | 
288 |
289 | The above seed, Yinmn Blue, or `59f2293a5bce7d4de59e71b4207ac5d2`, is used for the following examples. See [the crypto-seed test vectors](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/crypto-seed-test-vectors.md).
290 |
291 | `crypto-seeds` can be specifically requested by sending a `crypto-request` body that contains a typed 500 seed-digest for the seeds. This is the SHA256 of the seed, which can be calculated by programs such as `shasum`:
292 | ```
293 | $ echo '59f2293a5bce7d4de59e71b4207ac5d2' | xxd -r -p | shasum -a 256
294 | ffa11a8b90954fc89ae625779ca11b8f0227573a2f8b4ed85d96ddf901a72cea -
295 | ```
296 | This digest would then be listed as the first and only entry of the 500-encoded map:
297 | ```
298 | 2: 500({
299 | 1: 600(h'ffa11a8b90954fc89ae625779ca11b8f0227573a2f8b4ed85d96ddf901a72cea')
300 | })
301 |
302 | ```
303 |
304 | ### Seed-Digest Request for Yinmn Blue
305 |
306 | 
307 |
308 | ```
309 | {
310 | 1: 37(h'3CB81644ADA44ECB9DDFA285C14FA877'),
311 | 2: 500({
312 | 1: 600(h'ffa11a8b90954fc89ae625779ca11b8f0227573a2f8b4ed85d96ddf901a72cea')
313 | })
314 | }
315 | ```
316 |
317 | ```
318 | ur:crypto-request/oeadtpdagdfnrocmfypmoxglsbnturoelpsegwpdktaotaadwkoyadtaaohdhdcxzmoycylumhmdgwspnyvadaktnsoycwmyaodihgftdllugltphlmtutytadosdwwdetjsdwwt
319 | ```
320 |
321 | ### Seed-Digest Request for Yinmn Blue with Comment
322 |
323 | 
324 | ```
325 | {
326 | 1: 37(h'3CB81644ADA44ECB9DDFA285C14FA877'),
327 | 2: 500({
328 | 1: 600(h'ffa11a8b90954fc89ae625779ca11b8f0227573a2f8b4ed85d96ddf901a72cea')
329 | }),
330 | 3: "Seed request by ACME Exchange."
331 | }
332 | ```
333 | ```
334 | ur:crypto-request/oeadtpdagdenwebkjplanbgeytlkladywfmkjsrpwdaotaadykoeadwkaotaaddyoyadlocsdyykaeykaeykaoykynurjomh
335 | ```
336 |
337 | ### Sample Seed: Khaki
338 |
339 | See [the crypto-seed test vectors](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/crypto-seed-test-vectors.md) for our 256-bit test seed, Khaki.
340 |
341 | ```
342 | $ echo 'e3955cda304771c0031895637f55c3abe45153c87abd81c51ed14e8aafa1af13' | xxd -r -p | shasum -a 256
343 | 8b206fb05be13485e7e39f8fdba045ce01c98cf42b6687b083e71ae9739d3609 -
344 | ```
345 |
346 | ### Seed-Digest Request for Khaki
347 |
348 | 
349 |
350 | ```
351 | {
352 | 1: 37(h'3CB81644ADA44ECB9DDFA285C14FA877'),
353 | 2: 500({
354 | 1: 600(h'8b206fb05be13485e7e39f8fdba045ce01c98cf42b6687b083e71ae9739d3609')
355 | })
356 | }
357 | ```
358 |
359 | ```
360 | ur:crypto-request/oeadtpdagdfnrocmfypmoxglsbnturoelpsegwpdktaotaadwkoyadtaaohdhdcxzmoycylumhmdgwspnyvadaktnsoycwmyaodihgftdllugltphlmtutytadosdwwdetjsdwwt
361 | ``
362 | ## `crypto-psbt` Requests
363 |
364 | To test a PSBT:
365 |
366 | 1. [Add Alice seed](https://github.com/BlockchainCommons/GordianSeedTool-iOS/blob/master/Testing/PSBT%20Signing%20Request/Alice.pdf)
367 | 2. [Add Bob seed](https://github.com/BlockchainCommons/GordianSeedTool-iOS/blob/master/Testing/PSBT%20Signing%20Request/Bob.pdf)
368 | 3. [Test Alice signing](https://raw.githubusercontent.com/BlockchainCommons/GordianSeedTool-iOS/master/Testing/PSBT%20Signing%20Request/PSBT%20Signing%20Request%201%20of%202.png)
369 | 4. [Test Both signing](https://raw.githubusercontent.com/BlockchainCommons/GordianSeedTool-iOS/master/Testing/PSBT%20Signing%20Request/PSBT%20Signing%20Request%201%20of%202.png)
370 |
371 | ## Appendix: Standard Process for Creating Test Vectors:
372 |
373 | The following process, which can be used for all test vector creation, using a `crypto-request` of a `crypto-hdkey` as an example.
374 |
375 | 1. Produce a UUID
376 | ```
377 | $ uuidgen | sed s/-//g
378 | BD4CD51356B248D8A04C3609F5A737FA
379 | ```
380 | 2. Write the JSON vector using [BCR-2021-001](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2021-001-request.md) as reference. Place the UUID in map element #1 and any description in map element #3. Map element #2, the body, will vary based on the type of Request.
381 | ```
382 | {
383 | 1: 37(h'f684371af9d245589c1f1f888ec7b7a3'),
384 | 2: 501({
385 | 1: false,
386 | 2: 304({
387 | 1: [84, true, 0, true, 0, true]
388 | })
389 | })
390 | }
391 | ```
392 | 3. Encode the JSON with [CBOR Playground](https://cbor.me/). First test it with full description, then check "plain text" to just produce the hex.
393 | ```
394 | A201D82550F684371AF9D245589C1F1F888EC7B7A302D901F5A201F402D90130A101861854F500F500F5
395 | ```
396 | 4. Use `bytewords` with `hex` input and `minimal` output to produce the UR body.
397 | ```
398 | bytewords -i hex -o minimal A201D82550F684371AF9D245589C1F1F888EC7B7A302D901F5A201F402D90130A101861854F500F500F5
399 | oeadtpdagdynlremcyyttdfehdnsctctlomnstrlotaotaadykoeadwkaotaaddyoyadlncsghykaeykaeykaeuolywf
400 | ```
401 | 5. Add `ur:crypto-request/` as a prefix.
402 | ```
403 | ur:crypto-request/oeadtpdagdynlremcyyttdfehdnsctctlomnstrlotaotaadykoeadwkaotaaddyoyadlncsghykaeykaeykaeuolywf
404 | ```
405 | 6. Encode the `crypto-request` as a QR. Be sure to capitalize to maximize efficiency of QR.
406 | ```
407 | echo "ur:crypto-request/oeadtpdagdynlremcyyttdfehdnsctctlomnstrlotaotaadykoeadwkaotaaddyoyadlncsghykaeykaeykaeuolywf" | tr '[:lower:]' '[:upper:]' | qrencode -o ~/vector-segwit-single-pubkey.png
408 | ```
409 | ## TODO
410 |
411 | 2. Six (or twelve?) crypto-requests for hdkey from specific seed
412 | 3. Import and Export Yimn Blue
413 | 4. Import and Export Khaki
414 | 5. PSBT Test
415 |
416 |
--------------------------------------------------------------------------------
/Docs/crypto-seed-test-vectors.md:
--------------------------------------------------------------------------------
1 | # `crypto-seed` Test Vectors
2 |
3 | * [128 Bit Examples (Yinmn Blue)](#128-bit-examples-yinmn-blue)
4 | * [256 Bit Examples (Khaki)](#256-bit-examples-khaki)
5 |
6 | ## 128 Bit Examples (Yinmn Blue)
7 |
8 |
9 |
10 | ### Seed with No Additional Data
11 |
12 | 
13 |
14 | ```
15 | {
16 | 1: h'59f2293a5bce7d4de59e71b4207ac5d2'
17 | }
18 | ```
19 |
20 | ### Seed with Date
21 |
22 | 
23 |
24 | ```
25 | {
26 | 1: h'59f2293a5bce7d4de59e71b4207ac5d2',
27 | 2: 1(1645539742)
28 | }
29 | ```
30 |
31 | ### Seed with Date & Name
32 |
33 | 
34 |
35 | ```
36 | {
37 | 1: h'59f2293a5bce7d4de59e71b4207ac5d2',
38 | 2: 1(1645539742),
39 | 3: "Yinmn Blue Acid Exam"
40 | }
41 | ```
42 |
43 | ### Seed with Date, Name & Note
44 |
45 | 
46 |
47 | ```
48 | {
49 | 1: h'59f2293a5bce7d4de59e71b4207ac5d2',
50 | 2: 1(1645539742),
51 | 3: "Yinmn Blue Acid Exam",
52 | 4: "This is our standard 128-bit test seed."
53 | }
54 | ```
55 |
56 | ### Seed with Date, Name & Long Note
57 |
58 | **Static Version:**
59 |
60 | 
61 |
62 | **Animated Version:**
63 |
64 | [pending]
65 |
66 | ```
67 | {
68 | 1: h'59f2293a5bce7d4de59e71b4207ac5d2',
69 | 2: 1(1645539742),
70 | 3: "Yinmn Blue Acid Exam",
71 | 4: "This is our standard 128-bit test seed. However, this version of it has a very long note. Why? The object is to force the creation of an animated GIF, which demonstrates the power of URs, not just to allow for the self-identification of information, but also to do so in a way the integrates well with QR codes, creating an animated QR when the data would otherwise be too long for a static QR. To force that to happen, this note was made to be over 500 characters long, which is a lot of data for a QR, which maxes out at about 4,000 alphanumeric characters, but which gets very hard to read (especially from a phone) before that."
72 | }
73 | ```
74 |
75 | ## 256 Bit Examples (Khaki)
76 |
77 |
78 |
79 | ### Seed with No Additional Data
80 |
81 | 
82 |
83 | ```
84 | {
85 | 1: h'e3955cda304771c0031895637f55c3abe45153c87abd81c51ed14e8aafa1af13'
86 | }
87 | ```
88 |
89 | ### Seed with Date
90 |
91 | 
92 |
93 | ```
94 | {
95 | 1: h'e3955cda304771c0031895637f55c3abe45153c87abd81c51ed14e8aafa1af13',
96 | 2: 1(1645539742)
97 | }
98 | ```
99 | ### Seed with Date & Name
100 |
101 | 
102 |
103 | ```
104 | {
105 | 1: h'e3955cda304771c0031895637f55c3abe45153c87abd81c51ed14e8aafa1af13',
106 | 2: 1(1645539742),
107 | 3: "Khaki Gala Jazz"
108 | }
109 | ```
110 |
111 | ### Seed with Date, Name & Note
112 |
113 | 
114 |
115 | ```
116 | {
117 | 1: h'e3955cda304771c0031895637f55c3abe45153c87abd81c51ed14e8aafa1af13',
118 | 2: 1(1645539742),
119 | 3: "Khaki Gala Jazz",
120 | 4: "This is our standard 256-bit test seed."
121 | }
122 | ```
123 |
124 | ### Seed with Date, Name & Long Note
125 |
126 | **Static Version:**
127 |
128 | 
129 |
130 | **Animated Version:**
131 |
132 | [pending]
133 |
134 | ```
135 | {
136 | 1: h'e3955cda304771c0031895637f55c3abe45153c87abd81c51ed14e8aafa1af13',
137 | 2: 1(1645539742),
138 | 3: "Khaki Gala Jazz",
139 | 4: "This is our standard 256-bit test seed. However, this version of it has a very long note. Why? The object is to force the creation of an animated GIF, which demonstrates the power of URs, not just to allow for the self-identification of information, but also to do so in a way the integrates well with QR codes, creating an animated QR when the data would otherwise be too long for a static QR. To force that to happen, this note was made to be over 500 characters long, which is a lot of data for a QR, which maxes out at about 4,000 alphanumeric characters, but which gets very hard to read (especially from a phone) before that."
140 | }
141 | ```
142 |
143 | ## Crypto-Seed Requests
144 |
145 | For example requests for these seeds, see the [crypto-requests test vectors](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/crypto-request-test-vectors.md#crypto-seed-requests).
146 |
147 | ## Appendix: Standard Process for Creating Test Vectors:
148 |
149 | The following process, which can be used for all test vector creation, using a detailed `crypto-seed` as an example.
150 |
151 | 1. Write the JSON vector using [BCR-2020-006](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-006-urtypes.md#cryptographic-seed-crypto-seed) as reference. Place the hex seed in map element #1, and then optionally place a creation date in element #2, a name in element #3, and a note in element #4.
152 | ```
153 | {
154 | 1: h'59f2293a5bce7d4de59e71b4207ac5d2',
155 | 2: 1(1645539742),
156 | 3: "Yinmn Blue Acid Exam",
157 | 4: "This is our standard 128-bit test seed."
158 | }
159 | ```
160 | 2. Encode the JSON with [CBOR Playground](https://cbor.me/). First test it with full description, then check "plain text" to just produce the hex.
161 | ```
162 | A4015059F2293A5BCE7D4DE59E71B4207AC5D202C11A6214F19E037459696E6D6E20426C75652041636964204578616D04782754686973206973206F7572207374616E64617264203132382D626974207465737420736565642E
163 | ```
164 | 3. Use `bytewords` with `hex` input and `minimal` output to produce the UR body.
165 | ```
166 | bytewords -i hex -o minimal A4015059F2293A5BCE7D4DE59E71B4207AC5D202C11A6214F19E037459696E6D6E20426C75652041636964204578616D04782754686973206973206F7572207374616E64617264203132382D626974207465737420736565642E
167 | oxadgdhkwzdtfthptokigtvwnnjsqzcxknsktdaosecyidbbwnnnaxjyhkinjtjnjtcxfwjzkpihcxfpiainiecxfekshsjnaaksdighisinjkcxinjkcxjlkpjpcxjkjyhsjtiehsjpiecxeheyetdpidinjycxjyihjkjycxjkihihiedmksjpaate
168 | ```
169 | 4. Add `ur:crypto-seed/` as a prefix.
170 | ```
171 | ur:crypto-seed/oxadgdhkwzdtfthptokigtvwnnjsqzcxknsktdaosecyidbbwnnnaxjyhkinjtjnjtcxfwjzkpihcxfpiainiecxfekshsjnaaksdighisinjkcxinjkcxjlkpjpcxjkjyhsjtiehsjpiecxeheyetdpidinjycxjyihjkjycxjkihihiedmksjpaate
172 | ```
173 | 5. Encode the `crypto-request` as a QR.
174 | ```
175 | echo "ur:crypto-seed/oxadgdhkwzdtfthptokigtvwnnjsqzcxknsktdaosecyidbbwnnnaxjyhkinjtjnjtcxfwjzkpihcxfpiainiecxfekshsjnaaksdighisinjkcxinjkcxjlkpjpcxjkjyhsjtiehsjpiecxeheyetdpidinjycxjyihjkjycxjkihihiedmksjpaate" | qrencode -o ~/vector-seed-yinmn-note.png
176 | ```
177 |
178 |
--------------------------------------------------------------------------------
/Docs/key-derivations.md:
--------------------------------------------------------------------------------
1 | # Key Derivations
2 |
3 | We use the following names for common key derivations:
4 |
5 | ```
6 | Native Segwit Single Key
7 | wpkh(84'/0'/0')
8 |
9 | Native Segwit Multisig
10 | wsh(cosigner(48'/0'/0'/2'))
11 |
12 | Nested Segwit Single Key
13 | sh(wpkh(49'/0'/0'))
14 |
15 | Nested Segwit Multisig
16 | sh(wsh(cosigner(48'/0'/0'/1')))
17 |
18 | Legacy Single Key
19 | pkh(44'/0'/0')
20 |
21 | Legacy Multisig
22 | sh(cosigner(45'))
23 |
24 | Taproot Single Key
25 | tr(86'/0'/0')
26 | ```
27 |
--------------------------------------------------------------------------------
/Docs/sskr-cold-storage.md:
--------------------------------------------------------------------------------
1 | # SSKR Cold Storage
2 |
3 | [Smart Custody](https://www.smartcustody.com/), Blockchain Commons' 2019 guide to best practices for key management, suggests maintaining copies of keys etched in metal. Though SSKR can produced a much larger set of words, it can still be managed. Ken Sedgwick demonstrated one way to do so using dogtags and the [test vector](sskr-test-vector.md).
4 |
5 | His complete method requires the following shopping list (with two different options for the military embossing machine):
6 | https://gist.github.com/ksedgwic/d4d34cab504ac453eaf2a3656f86e2f6#file-dogtag-parts-md
7 |
8 | The overall procedure is simple:
9 |
10 | 1. Print out your SSKR as a guide.
11 | 2. Optionally, print a [new sheet](https://gist.github.com/ksedgwic/ce28cedd58b40fdb6522c905c07655e4) to divide each SSKR into two parts.
12 | 3. Emboss each share onto a pair of tags using the machine.
13 |
14 | 
15 |
16 | You could stop there, but Ken suggests additional security:
17 |
18 | 4. Bolt each pair of tags against a blank tag to make them unreadable.
19 | 5. Dip each set of bolted tags in black plasti dip to bind them together.
20 | 6. Cover the edges of the dip with glitter to form a unique pattern that can't be replicated.
21 | 7. Photograph the patterns so that you can later test if the tags have been opened up.
22 |
23 | 
24 |
25 | Ken [has more photographs](https://photos.google.com/share/AF1QipMdrblk43sLJQeeMAcrT6AH9r9Peb9kENyAF6aflZbQD5Bqbyi8zSLegHg5akUYYg?key=WlJVd3ZLakI2Y0NoSnFiRkE1RjFCWks5Zjl0U1BB) of the entire procedure.
26 |
--------------------------------------------------------------------------------
/Docs/sskr-developers.md:
--------------------------------------------------------------------------------
1 | # SSKR for Developers
2 |
3 | SSKR is Sharded Secret Key Reconstruction. It's a methodology for secret sharing
4 | that allows for the sharding of a master seed into multiple shares, which may then be combined with a certain threshold to reconstruct that secret. Major expansions of the SSKR specification over previous standards include:
5 |
6 | 1. Compatibility with BIP-39.
7 | 2. Implementation of two-level shares.
8 | 3. Encoding of shares as ByteWords.
9 | 4. Integration with URs.
10 |
11 | Currently, SSKR supports one secret-sharing algorithm: Shamir's Secret Sharing, which is version `0` of SSKR types. As such, it's intended to replace SLIP-39 as a specification for Shamir's Secret Sharing.
12 |
13 | ## Where Can I Find SSKR?
14 |
15 | **Specification:**
16 |
17 | SSKR is described in a Blockchain Commons research paper.
18 |
19 | * [BCR-0011: UR Type Definition for Sharded Secret Key Reconstruction (SSKR)](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-011-sskr.md)
20 |
21 | **Code Libraries:**
22 |
23 | The core of SSKR is in the `bc-sskr` library:
24 |
25 | * [bc-sskr](https://github.com/blockchaincommons/bc-sskr) (C library)
26 |
27 | However, SSKR was built with a modular design allowing developers to choose both the underlying secret sharing and the encoding that they use.
28 |
29 | The Shamir's Secret Sharing used by default with SSKR is found in the `bc-shamir` library, which is supported by the `bc-crypto-base` library:
30 |
31 | * [bc-crypto-base](https://github.com/blockchaincommons/bc-crypto-base) (C library)
32 | * [bc-shamir](https://github.com/blockchaincommons/bc-shamir) (C library)
33 |
34 | SSKR's default encoding method is ByteWords, which is available in the `bc-bytewords` library:
35 |
36 | * [bc-bytewords](https://github.com/BlockchainCommons/bc-bytewords) (C library)
37 |
38 | Many of these libraries are available in the following conversions:
39 |
40 | * [bc-libs-java](https://github.com/BlockchainCommons/bc-libs-java) (Java library for crypto-base, shamir, sskr, and bytewords)
41 | * [BCLibsSwift](https://github.com/BlockchainCommons/BCLibsSwift) (Swift library for crypto-base, shamir, and sskr)
42 |
43 | **Sample Code:**
44 |
45 | The following applications demonstrate the usage of SSKR:
46 |
47 | * [Gordian SeedTool](https://github.com/BlockchainCommons/GordianSeedTool-iOS) (app implementation)
48 | * [LetheKit](https://github.com/BlockchainCommons/bc-lethekit) (hardware implementation)
49 | * [SeedTool CLI](https://github.com/BlockchainCommons/bc-seedtool-cli) (CLI implementation)
50 |
51 | ## How Do I Use SSKR?
52 |
53 | SSKR allows you to protect a 32-byte seed. You will also need to think about a few other things when utilizing SSKR:
54 |
55 | * The seed being encrypted must be truly random, with high entropy.
56 | * The shares are non-deterministic due to a random factor in their creation. This means that shares will look different every time you generate them.
57 | * If you need to protect more than 32 bytes, you will need to either create muktiple SSKR objects or else encrypt the additional data using the 32-byte value being protected by SSKR as an encryption key.
58 |
59 | The last point is particularly notable because multilayered encryption of this type is required to protect a standard BIP-32 HD wallet, which is typically built with a 32-byte private key and its 32-byte chain code; it is also necessary to preserve metadata related to any 32-byte key. It may also be required in other situations where more than 32 bytes are being preserved for later reconstruction.
60 |
61 | ## Why Use Shamir's Secret Sharing?
62 |
63 | Shamir's Secret Sharing (SSS) is built on an old, well-respected cryptographic proof, and so we have faith in its foundational concepts.
64 |
65 | Though we believe that [the usage of multisig](https://github.com/BlockchainCommons/Gordian/blob/master/Docs/Multisig.md) is superior to SSS, because Shamir's Secret Sharing can expose the user to vulnerability on the machine where a key is reconstructed, we nonetheless acknowledge that many users prefer Shamir's Secret Sharing, in large part for compatibility with last-generation single-signature addresses.
66 |
67 | So, while we're leading the way in using multisig to better protect our digital wealth, we're also interested in improving the interoperability of resilient, single-signature addresses, and that primarily means improving the interoperability of Shamir's Secret Sharing.
68 |
69 | ## What are Two-Level Shares?
70 |
71 | Using SSKR, you can implement Shamir's Secret Sharing as normal, using a group of shares with a threshold for reconstruction. However, you can also implement a two-level hierarchy with multiple groups, each of which contain some shares. You can then specify a threshold for both groups and shares.
72 |
73 | For example, you could create shares for 2 groups: the first group might require 2 of 3 shares and the second group might require 3 of 5 shares. With a group threshold of 2, individual thresholds from both groups must be met.
74 |
75 | ## What are ByteWords?
76 |
77 | SSKR shares can be output as [Bytewords](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-012-bytewords.md), which is a specification for outputting encoded binary data as English words. We purposefully differentiated it from the BIP-39 mnemonics to avoid confusion: we wanted to make it obvious that the shares were SSKR, as evidenced by the ByteWords encoding, as opposed to SLIP-39, which would use BIP-39 encoding.
78 |
79 | ByteWords also has several advantages. It's as efficient as hex, the words are all a uniform four letters, there are no homophones, and the first and last characters of each word differ from other words. Words were also specifically chosen to either be concrete or else to have valence. All around, the goal was to make ByteWords very easy to distinguish.
80 |
81 | ## What are URs?
82 |
83 | URs are [Uniform Resources](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md), another Blockchain Commons specification. They describe a methodology for efficient, self-describing resources, and are easily interoperable with ByteWords. We choose them as another output format for SSKR.
84 |
85 | See [A Guide to Using URs for SSKRs](ur-3-sskrs.md) for how ByteWord SSKRs and UR SSKRs are encoded, and how they slightly differ.
86 |
87 | ## Why Did We Create a New Standard?
88 |
89 | We are well aware of the problems of creating yet more standards, as depicted by the ever-insightful Randall Munroe:
90 |
91 | 
92 |
93 | In the case of SSKR we felt that the creation of a new specification for Shamir's Secret Sharing was critical due to problems that we identified with the previous implementations, primarily SLIP-39, which we discovered [did not round trip with BIP-39](https://github.com/BlockchainCommons/bc-lethekit/issues/38).
94 |
95 | The result is SSKR, which is similar to SLIP-39, but not compatible. It includes the same Shamir's Secret Sharing technology, but uses a different key-derivation methodology, for compatibility with BIP-39.
96 |
97 | Seeing the need for a new specification that roundtripped with BIP-39 also allowed the possibility for expansion, which permitted us to introduce two-level shares as a major new feature.
98 |
99 | ## Why Did We Create New Libraries?
100 |
101 | Obviously, with a new specification, we also needed libraries for that specification. We created C reference libraries for SSS and SSKR and modularizing the contents to allow a developer to pick and choose how they were put together. These libraries were later converted to Java, then our [contributing sponsor Bitmark](https://bitmark.com/) converted them to Swift.
102 |
103 | Our new libraries also resolve one of our long-standing problems with SSS: we've always felt that Shamir's Secret Sharing looked deceptively easy to code, which has resulted in more than one implementation incorporating fundamental problems, from the lack of round-tripping in SLIP-39, to incorrect use of entropy in other implementations. Thus, we were happy to offer our own implementation, building on the cryptographic expertise of Blockchain Commons members and other experts in the field such as Daan Sprenkels.
104 |
105 | ## What is the Foundation of SSKR?
106 |
107 | SSKR is the end-result of over two years of effort. It most immediately grew out of workgroups at the Rebooting the Web of Trust design workshops. At [RWOT8 in Barcelona](https://github.com/WebOfTrustInfo/rwot8-barcelona), a group of experts worked on "Shamir's Secret Sharing Best Practices" and the foundation of a new library, while at [RWOT9 in Prague](https://github.com/WebOfTrustInfo/rwot9-prague), a new cohort further discussed use cases, formats, and the two-level scheme. These workgroups included experts such as Christopher Allen, Bryan Bishop, Laurence Chen, Hank Chiu, Mark Friedenbach, Chris Howe, Yancy Ribbens, Daan Sprenkels, ChiaWei Tang, and others. Initial work on Blockchain Common's `bc-shamir` library grew from Daan's work on his own [SSS library](https://github.com/dsprenkels/sss). Further encouragement to produce the new SSKR specification came from Ken Sedgwick, who identified the round-tripping problems between BIP-39 and SLIP-39.
108 |
109 | ## What is the Future of SSKR?
110 |
111 | SSKR was designed from the beginning to work with different types of secret sharing. The first expansion is likely to be into VSS.
112 |
113 | _Also see the [SSKR Example & Test Vector](sskr-test-vector.md) for a ready-to-use seed and [A Guide to Using URs for SSKRs](https://github.com/BlockchainCommons/crypto-commons/blob/shannona-docs-sskr-request-response/Docs/ur-3-sskrs.md) for discussions of a variety of SSKR formatting._
114 |
115 | _For a higher level discussion of secret-sharing designs and dangers, see our #SmartCustody articles on [Designing SSKR Share Scenarios](https://github.com/BlockchainCommons/SmartCustody/blob/master/Docs/SSKR-Sharing.md) and [The Dangers of Secret-Sharing Schemes](https://github.com/BlockchainCommons/SmartCustody/blob/master/Docs/SSKR-Dangers.md)._
116 |
117 | _For a discussion of using SSKR for storing more data than just seeds, such as descriptors, transaction details, etc. see the [CSR - Collaborative Seed Recovery Project](https://github.com/BlockchainCommons/Gordian/blob/master/CSR/README.md)
118 |
119 |
--------------------------------------------------------------------------------
/Docs/sskr-overview.md:
--------------------------------------------------------------------------------
1 | # SSKR Docs
2 |
3 | SSKR stands for Sharded Secret Key Reconstruction. It's a specification that allows you to securely create a backup of your cryptoseeds by sharding those secrets. It uses the mature Shamir’s Secret Sharing functionality, but with more choices of output and options for advanced two-tiered shards.
4 |
5 | Users can use SSKR to easily shard a seed. Our reference tools for iOS, macOS, and UNIX demo the functionality, but we expect more cryptocurrency wallet manufacturers to soon be incorporating SSKRs as well.
6 |
7 | Seedtool, our iOS and macOS reference tool, allows you to print your sares and distribute them as coupons, which include QRs of the shares that can be stored in a QR vault. If you run the Mac version of Seedtool, you can instead print them directly to a PDF!
8 |
9 | But you can also secure shares in other ways, such as etching the words into steel to ensure you never lose your cryptocurrency seed. We have a demo on how to do it with steel dog tags!
10 |
11 | There are other advantages as well, including BIP-39 roundtripping and the usage of words that are less-likely to be confused. Take a look, we talk about it all in our docs!
12 |
13 | Developers of all sorts should find it easy to incorporate the functionality, thanks to libraries available in multiple programming languages, plus a large collection of documents.
14 |
15 | If you’d like to see more #SmartCustody work to support responsible key management, including more specifications and references for creating wallet interoperability. Support Blockchain Commons by [becoming a patron](https://github.com/sponsors/BlockchainCommons)!
16 |
17 | ## Intro
18 |
19 | The following overviews SSKR.
20 |
21 | * [SSKR for Users](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/sskr-users.md)
22 | * [SSKR in Technology Overview Video](https://www.youtube.com/watch?v=RYgOFSdUqWY&t=1612s)
23 | * [Early Demo Video](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/sskr-video.md)
24 |
25 | ## For Users
26 |
27 | How can you use SSKR? The following describes its usage in [Gordian Seed Tool](https://apps.apple.com/us/app/gordian-seed-tool/id1545088229).
28 |
29 | * [Sharding a Seed (from Gordian Seed Tool Manual)](https://github.com/BlockchainCommons/GordianSeedTool-iOS/blob/master/Docs/MANUAL.md#sharding-a-seed)
30 | * [Importing SSKR Shards (from Gordian Seed Tool Manual)](https://github.com/BlockchainCommons/GordianSeedTool-iOS/blob/master/Docs/MANUAL.md#importing-sskr-shares)
31 |
32 |
33 |
34 |
35 |
36 |
37 |
SSKR Export
38 | |
39 |
40 |
41 |
SSKR Coupons
42 | |
43 |
44 |
45 |
SSKR Import
46 | |
47 |
48 |
49 |
50 |
51 | ## For Power Users
52 |
53 | Want to do more with SSKR? The following describes how to design SSKR sharing, how to put your shares in cold storage:
54 |
55 | * [Designing SSKR Share Scenarios](https://github.com/BlockchainCommons/SmartCustody/blob/master/Docs/SSKR-Sharing.md)
56 | * [SSKR Dangers](https://github.com/BlockchainCommons/SmartCustody/blob/master/Docs/SSKR-Dangers.md)
57 | * [SSKR Cold Storage Example](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/sskr-cold-storage.md)
58 |
59 | We've also got docs for using SSKR with [`seedtool-cli`](https://github.com/BlockchainCommons/seedtool-cli):
60 |
61 | * [SSKR from Command Line (from `seedtool-cli` manual)](https://github.com/BlockchainCommons/seedtool-cli/blob/master/Docs/MANUAL.md#sskrs)
62 |
63 | ## For Developers
64 |
65 | Want to develop using SSKR? The following provide an array of documents for using SSKR and placing them in URs, as well as info on test vectors, and our security review.
66 |
67 | * [SSKR for Developers](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/sskr-developers.md)
68 | * [Guide for Using URs for SSKR](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/ur-3-sskrs.md)
69 | * [UR Type Definition for Sharded Secret Key Reconstruction (SSKR)](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-011-sskr.md)
70 | * [SSKR Test Vectors](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/sskr-test-vector.md)
71 | * [Security Review of bc-shamir & bc-sskr libraries](https://github.com/BlockchainCommons/bc-shamir/blob/master/SECURITY-REVIEW.md)
72 |
73 | You might also want to read about the foundational technology of Shamir's Secret Sharing itself:
74 |
75 | * [Shamir’s Secret Sharing: An Overview](https://docs.google.com/document/d/1rZJlFZcftrCM_KaxFnHUIskJKlSQzF0zFn4WIRQGDLU/edit#heading=h.imy5xgr88lxa)
76 |
77 | ## Code
78 |
79 | Ready to code? Developers can use the following libraries to incorporate SSKR in their own programs.
80 |
81 | * [bc-shamir - Shamir Secret Sharing reference library in C](https://github.com/BlockchainCommons/bc-shamir)
82 | * [bc-sskr - Sharded Secret Key Reconstruction (SSKR) reference library in C](https://github.com/BlockchainCommons/bc-shamir)
83 | * [bc-libs-java - Java ports of the Shamir and SSKR libraries](https://github.com/BlockchainCommons/bc-libs-java)
84 | * [BCLibsSwift - Swift ports of the Shamir and SSKR libraries](https://github.com/BlockchainCommons/BCLibsSwift)
85 |
86 | Please note that at this time only the core C-language libraries have been [security reviewed](https://github.com/BlockchainCommons/bc-shamir/blob/master/SECURITY-REVIEW.md). If you are introducing in using the Java or Swift ports, or creating a new library, a new security review will be required for a secure production release.
87 |
88 | ### Reference Tools
89 |
90 | Want to verify your code? That's what the Blockchain Commons reference tools are for.
91 |
92 | * [seedtool-cli - Cryptographic Seed Tool for the command line](https://github.com/BlockchainCommons/seedtool-cli)
93 | * [Gordian Seed Tool iOS - Cryptographic Seed Manager for iOS & Mac](https://github.com/BlockchainCommons/GordianSeedTool-iOS)
94 |
95 | ## Related
96 |
97 | The following topics are related to SSKR.
98 |
99 | * [Creating an Autonomous Multisig from Building Blocks (from Designing Multisig for Independence & Resilience)](https://github.com/BlockchainCommons/SmartCustody/blob/master/Docs/Multisig.md#alternative-creating-an-autonomous-multisig-from-building-blocks)
100 | * [RWOT9 - Evaluating Social Recovery](https://github.com/WebOfTrustInfo/rwot8-barcelona/blob/master/final-documents/evaluating-social-recovery.md)
101 |
102 | ## Support
103 |
104 | To support the continued creation and growth of specifications such as this, please become a sponsor of Blockchain Commons, either through [GitHub](https://github.com/sponsors/BlockchainCommons) or through Bitcoin donations on our [BTCpay](https://btcpay.blockchaincommons.com/). Thank you to our [sustaining and additional sponsors](https://www.blockchaincommons.com/sponsors.html).
105 |
106 | Please also join us in our [Airgapped Wallet Community](https://github.com/BlockchainCommons/Airgapped-Wallet-Community/discussions) where we are discussing and advancing this and other specifications.
107 |
--------------------------------------------------------------------------------
/Docs/sskr-test-vector.md:
--------------------------------------------------------------------------------
1 | # SSKR Example & Test Vector
2 |
3 | SSKR shards a seed to create shares that can then be distributed to other parties for later retrieval. The following example offers a test vector of a seed and shows its SSKR equivalents.
4 |
5 | ## 128-bit Seed
6 |
7 | This example is built from the seed:
8 | ```
9 | 59f2293a5bce7d4de59e71b4207ac5d2
10 | ```
11 | This seed can be stored in [Gordian SeedTool](https://github.com/BlockchainCommons/GordianSeedTool-iOS), which can reveal other info about the seed, such as how to back it up with either Blockchain Commons' [ByteWords](https://github.com/BlockchainCommons/bc-bytewords) or traditional BIP39 words:
12 |
13 | 
14 |
15 | The ByteWords for `59f2293a5bce7d4de59e71b4207ac5d2` are:
16 | ```
17 | hawk whiz diet fact help taco kiwi gift view noon
18 | jugs quiz crux kiln silk tied omit keno lung jade
19 | ```
20 | The BIP39 words are:
21 | ```
22 | fly mule excess resource treat plunge nose soda reflect adult ramp planet
23 | ```
24 | If you'd like to test the seed yourself, download [Gordian SeedTool for iOS](https://apps.apple.com/us/app/gordian-seed-tool/id1545088229) and click the "QR" icon at the top to scan a QR code. Point it to the QR code above and you'll load this Test Vector into your own phone!
25 |
26 | ### The SSKR
27 |
28 | [SSKR](https://github.com/BlockchainCommons/bc-sskr) uses Shamir's Secret Sharing to shard a secret, such as the DPAL Test seed, so that the secret can be restored using some threshold of those secrets.
29 |
30 | #### Two-of-Three SSKR
31 |
32 | A traditional use of Shamir's Secret Sharing might shard a secret into three shares, and then allow the secret to be restored from two of those shares.
33 |
34 | The following shows a set of 2-of-3 shares generated by Gordian SeedTool and exported as ByteWords:
35 | ```
36 | tuna acid epic gyro jury jump able acid able flap rust king
37 | roof item vast real hang plus free menu good plus keno vast
38 | gray maze oval whiz tomb
39 |
40 | tuna acid epic gyro jury jump able acid acid kiln main tuna
41 | keno able view plus gush body nail silk girl ruin visa curl
42 | yell loud rock jury fuel
43 |
44 | tuna acid epic gyro jury jump able acid also exam high dark
45 | echo ruin wand lazy gray swan visa fish jazz logo gift kick
46 | atom wall yank atom many
47 | ```
48 | The following shows that same 2-of-3 share exported as a [Uniform Resource (UR)](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md):
49 | ```
50 | ur:crypto-sskr/gojyjpaeadaefprtkgrfimvtrlhgpsfemugdpskovtgybagtiomh
51 | ur:crypto-sskr/gojyjpaeadadknmntakoaevwpsghbynlskglrnvaclylcmgdvyad
52 | ur:crypto-sskr/gojyjpaeadaoemhhdkeornwdlygysnvafhjzlogtkkamkockmuso
53 | ```
54 | A UR uses the minimal bytewords form, meaning that it shows only the first and last letter of each word. This means that "go" is "gyro", "jy" is "jury", "jp" is "jump", "ae" is "able", etc. You can see that the "UR" form of the three shares thus precisely matches the ByteWords except that the first three words ("tuna acid epic"), identifying it as an SSKR, has been omitted, and this changes the checksum, which is the last four words.
55 |
56 | > :warning: **WARNING.** SSKR is non-deterministic. There is a random factor introduced when the shares are created, which means that every time you generate shares, they will be different. This is an expected and correct result.
57 |
58 | #### The Two-of-Three Two-of-Three SSKR
59 |
60 | One of the advantages of SSKR is that it can support arbitrary groups, where you can then reconstruct a secret by using some number of shares from some number of groups.
61 |
62 | One example is a two-of-three two-of-three (grouped four-of-nine) SSKR. Three groups are created, each of which has three shares. Reconstructing the secret requires a threshold of two shares from a threshold of two groups. In other words, the secret can be reconstructed from four of the nine shares, provided that they are two each from two of the groups.
63 |
64 | For a more complex SSKR such as this, you might want to use Gordian SeedTool's print function, rather than cutting and pasting SSKRs or URs:
65 |
66 | 
67 | 
68 | 
69 |
70 | ## 256-bit Seed
71 |
72 | This example is built from the seed:
73 | ```
74 | e3955cda304771c0031895637f55c3abe45153c87abd81c51ed14e8aafa1af13
75 | ```
76 | This seed can be stored in [Gordian SeedTool](https://github.com/BlockchainCommons/GordianSeedTool-iOS), which can reveal other info about the seed, such as how to back it up with either Blockchain Commons' [ByteWords](https://github.com/BlockchainCommons/bc-bytewords) or traditional BIP39 words:
77 |
78 |
79 |
80 | The ByteWords for `59f2293a5bce7d4de59e71b4207ac5d2` are:
81 | ```
82 | vial mild high twin duty fuel jugs rust apex cats
83 | mild idea lamb gyro scar play vibe gray guru soap
84 | kiln ruby lazy silk cook tent girl love pose obey
85 | pose brew exit gray king iced
86 | ```
87 | The BIP39 words are:
88 | ```
89 | toe priority custom gauge jacket theme arrest bargain gloom wide ill fit eagle prepare capable fish limb cigar reform other priority speak rough imitate
90 | ```
91 | If you'd like to test the seed yourself, download [Gordian SeedTool for iOS](https://apps.apple.com/us/app/gordian-seed-tool/id1545088229) and click the "QR" icon at the top to scan a QR code. Point it to the QR code above and you'll load this Test Vector into your own phone!
92 |
93 | #### Two-of-Three SSKR
94 |
95 | A traditional use of Shamir's Secret Sharing might shard a secret into three shares, and then allow the secret to be restored from two of those shares.
96 |
97 | The following shows a set of 2-of-3 shares generated by Gordian SeedTool and exported as ByteWords:
98 | ```
99 | tuna acid epic hard data love wolf able acid able
100 | duty surf belt task judo legs ruby cost belt pose
101 | ruby logo iron vows luck bald user lazy tuna belt
102 | guru buzz limp exam obey kept task cash saga pool
103 | love brag roof owls news junk
104 |
105 | tuna acid epic hard data love wolf able acid acid
106 | barn peck luau keys each duty waxy quad open bias
107 | what cusp zaps math kick dark join nail legs oboe
108 | also twin yank road very blue gray saga oboe city
109 | gear beta quad draw knob main
110 |
111 | tuna acid epic hard data love wolf able acid also
112 | fund able city road whiz zone claw high frog work
113 | deli slot gush cats kiwi gyro numb puma join fund
114 | when math inch even curl rich vows oval also unit
115 | brew door atom love gyro figs
116 | ```
117 | The following shows that same 2-of-3 share exported as a [Uniform Resource (UR)](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md):
118 | ```
119 | ur:crypto-sskr/hddalewfaeadaedysfbttkjolsryctbtperyloinvslkbdurlytabtgubzlpemoykttkchsapllebgvdgleedp
120 | ur:crypto-sskr/hddalewfaeadadbnpkluksehdywyqdonbswtcpzsmhkkdkjnnllsoeaotnykrdvybegysaoecygrbavssktbti
121 | ur:crypto-sskr/hddalewfaeadaofdaecyrdwzzecwhhfgwkdistghcskigonbpajnfdwnmhihenclrhvsolaoutbwdrhliazcia
122 | ```
123 | A UR uses the minimal bytewords form, meaning that it shows only the first and last letter of each word. This means that "go" is "gyro", "jy" is "jury", "jp" is "jump", "ae" is "able", etc. You can see that the "UR" form of the three shares thus precisely matches the ByteWords except that the first three words ("tune acid epic"), identifying it as an SSKR, has been omitted, and this changes the checksum, which is the last four words.
124 |
125 | > :warning: **WARNING.** SSKR is non-deterministic. There is a random factor introduced when the shares are created, which means that every time you generate shares, they will be different. This is an expected and correct result.
126 |
127 | #### The Two-of-Three Two-of-Three SSKR
128 |
129 | One of the advantages of SSKR is that it can support arbitrary groups, where you can then reconstruct a secret by using some number of shares from some number of groups.
130 |
131 | One example is a two-of-three two-of-three (grouped four-of-nine) SSKR. Three groups are created, each of which has three shares. Reconstructing the secret requires a threshold of two shares from a threshold of two groups. In other words, the secret can be reconstructed from four of the nine shares, provided that they are two each from two of the groups.
132 |
133 | For a more complex SSKR such as this, you might want to use Gordian SeedTool's print function, rather than cutting and pasting SSKRs or URs:
134 |
135 | 
136 | 
137 | 
138 |
139 |
140 | ## Final Notes
141 |
142 | SSKR is a powerful way to back up digital secrets. This example demonstrates a specific seed and how it can be used to generate SSKR shares using two different groupings.
143 |
144 | See [SSKR Cold Storage](sskr-cold-storage.md) for an example of how to store this test vector by etching it in metal.
145 |
146 |
147 |
--------------------------------------------------------------------------------
/Docs/sskr-users.md:
--------------------------------------------------------------------------------
1 | # SSKR for Users
2 |
3 | SSKR is Sharded Secret Key Reconstruction. It's a way that you can divide ("shard") the master seed underlying a Bitcoin HD wallet into "shares", which you can then distribute to friends, family, or fiduciaries. If you ever lose your seed, you can then "reconstruct" it by collecting sufficient of your shares (the "threshold").
4 |
5 | ## How Does SSKR Work?
6 |
7 | The basic level of SSKR allows you to create a single group of shares, with a threshold for how many of those must be collected to reconstruct your seed. The following shows an example from [Gordian SeedTool](https://github.com/BlockchainCommons/GordianSeedTool-iOS) of creating three shares, of which two must be recovered.
8 |
9 |
10 |
11 |
12 |
13 | |
14 |
15 |
16 | |
17 |
18 |
19 |
20 |
21 | You would take these shares and give one each to three different trusted people (or places, such as a safe or bank vault).
22 |
23 | Note [the overlap in words in different shares](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/ur-3-sskrs.md#the-difference-between-sskr-bytewords-and-sskr-urs): this is expected. The first four words will always be the same as they describe the share as SSKR ("tuna acid epic") of a specific length ("gyro"). The next two ("navy grim") are a fingerprint that match all the shares in a split, and the next two ("able acid") describe the group threshold, count, and index, plus the member threshold, so they're the same for all the shares in a group.
24 |
25 | SSKR | length | ID | group & member info | secret share | checksum
26 | ---|---|---|---|---|---
27 | tuna acid epic | gyro | navy grim | able acid able | dice good ... edge iris | inch plus oboe ruby
28 |
29 | Note also that your words will change each time you regenerate SSKR shares from a secret. This is also expected: there is a random factor in SSKR generation.
30 |
31 | ## How Does Advanced SSKR Work?
32 |
33 | SSKR supports a more advanced methodology where you can define multiple groups, and then require a certain number of shares to come back from each group for a certain number of groups.
34 |
35 | The following shows an example from [Gordian SeedTool](https://github.com/BlockchainCommons/GordianSeedTool-iOS) where either 2 of 3 shares must come back from the first group or 3 of 5 shares must come back from the second group. (If the group threshold was increased to 2, then those _both_ would be required.)
36 |
37 |
38 |
39 |
40 |
41 | |
42 |
43 |
44 | |
45 |
46 |
47 |
48 |
49 | This can allow for more complex scenarios, such as a business that hands off one set of shares to Chief Officers, and then backs that up with a set of shares held by their accountants or some other fiduciary.
50 |
51 | Once you generate advanced SSKR shares, you would distribute them just like basic SSKR shares, but here being very careful to understand the roles of everyone you're giving shares to, since you're creating a more complex procedure.
52 |
53 | ## How Can I Record my SSKR Shares?
54 |
55 | You can record an SSKR share by storing the ByteWords in a safe and recoverable form. We suggest [etching it in steel or titanium](https://github.com/BlockchainCommons/SmartCustodyBook/blob/master/manuscript/02-scenario.md#optional-step-use-metal-alternative-single-metal-tile--engraver) and have documented [a full example of a cold storage scenario](https://hackmd.io/8SEy7aZbTjCG0mJQI6N5zg).
56 |
57 | Technically, you don't need to record every word: the first four words can be removed if you know that you're recording an SSKR of a specific length, and the last four can be removed as they're checksums. If that makes you more likely to record your ByteWords, then do so. But it's always better to record the whole thing to have the complete, self-describing information about your share.
58 |
59 | ## How Can I Reconstruct from SSKR?
60 |
61 | SSKR-compliant wallet tools should allow you to paste in your SSKR and reconstruct your seed, as shown in the following example for [Gordian SeedTool](https://github.com/BlockchainCommons/GordianSeedTool-iOS)
62 |
63 |
64 |
65 |
66 |
67 | |
68 |
69 |
70 |
71 |
72 | From there, your seed should be reconstructed and ready to go!
73 |
74 | ## Why Would I Use SSKR?
75 |
76 | SSKR provides resilience for your keys. If you lose your master seed, you can then reconstruct it by recovering the threshold number of shares (or in the case of an advanced scenario, the threshold number of shares from the threshold number of groups).
77 |
78 | SSKR simultaneously provides security. Because a number of shares must be combined to reconstruct a key, no individual could steal your digital assets; instead, a number would have to collude to do so, and you can design an SSKR scenario that makes that unlikely.
79 |
80 | There is one caveat to using SSKR:
81 |
82 | > _**WARNING.**_ The machine where you are reconstructing your key can be a vulnerability because your whole key is available at that location.
83 |
84 | For that reason, we generally suggest [multisig](https://github.com/BlockchainCommons/Gordian/blob/master/Docs/Multisig.md) as a superior [#SmartCustody tool](https://www.smartcustody.com/). Nonetheless, we recognize that many people still use single-signature addresses, and for those situations, SSKR is an excellent tool for protecting your funds.
85 |
86 | ## Where is SSKR Available?
87 |
88 | Though the examples here demonstrate SSKR with Gordian SeedTool, SSKR is a Blockchain Commons specification that we are making available to wallet manufacturers. We expect to see it become widely used in other products.
89 |
90 | ## What is the Foundation of SSKR?
91 |
92 | SSKR is the end-result of over two years of effort. It most immediately grew out of workgroups at the Rebooting the Web of Trust design workshops. At [RWOT8 in Barcelona](https://github.com/WebOfTrustInfo/rwot8-barcelona), a group of experts worked on "Shamir's Secret Sharing Best Practices" and the foundation of a new library, while at [RWOT9 in Prague](https://github.com/WebOfTrustInfo/rwot9-prague), a new cohort further discussed use cases, formats, and the two-level scheme. These workgroups included experts such as Christopher Allen, Bryan Bishop, Laurence Chen, Hank Chiu, Mark Friedenbach, Chris Howe, Yancy Ribbens, Daan Sprenkels, ChiaWei Tang, and others. Initial work on Blockchain Common's `bc-shamir` library grew from Daan's work on his own [SSS library](https://github.com/dsprenkels/sss). Further encouragement to produce the new SSKR specification came from Ken Sedgwick, who identified the round-tripping problems between BIP-39 and SLIP-39.
93 |
94 | _For more SSKR for Users, also see our [video example](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/sskr-video.md) and our [cold storage usage](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/sskr-cold-storage.md)._
95 |
--------------------------------------------------------------------------------
/Docs/sskr-video.md:
--------------------------------------------------------------------------------
1 | # SSKR Video Example
2 |
3 | The following video shows the recovery of a [Gordian Wallet](https://github.com/BlockchainCommons/GordianWallet-iOS) with SSKR shares, using first an example with a threshold of two, then an example with a threshold of three. It goes by very quickly!
4 |
5 | [](http://www.youtube.com/watch?v=PIND7J096U8 "Recover with SSKR")
6 |
7 | In the video, the user scans QR codes for the SSKRs, rebuilds the account within Gordian Wallet, then looks at addresses to ensure the wallet is correct.
8 |
--------------------------------------------------------------------------------
/Docs/ur-1-overview.md:
--------------------------------------------------------------------------------
1 | Please see our [Uniform Resources Developers page](https://developer.blockchaincommons.com/ur/)
2 |
--------------------------------------------------------------------------------
/Docs/ur-2-keys.md:
--------------------------------------------------------------------------------
1 | Please see our [Uniform Resources keys page](https://developer.blockchaincommons.com/ur/keys/).
2 |
--------------------------------------------------------------------------------
/Docs/ur-3-sskrs.md:
--------------------------------------------------------------------------------
1 | Please see our [Uniform Resources SSKR page](https://developer.blockchaincommons.com/ur/sskr/).
2 |
--------------------------------------------------------------------------------
/Docs/ur-4-psbt.md:
--------------------------------------------------------------------------------
1 | Please see our [UR PSBT Developers page](https://developer.blockchaincommons.com/ur/psbts/).
2 |
--------------------------------------------------------------------------------
/Docs/ur-99-request-response.md:
--------------------------------------------------------------------------------
1 | Please see our [Envelope Request & Response Developers page](https://developer.blockchaincommons.com/envelope/request/) for the updated way to do this and the [Request & Response Implementation Guide](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2024-004-request.md) for a more thorough description of how to put them together.
2 |
--------------------------------------------------------------------------------
/Docs/ur-envelope-request.md:
--------------------------------------------------------------------------------
1 | # A Guide to Using UR Envelope Request & Response
2 |
3 | STANDARD:
4 | DragonBook:~ ShannonA$ bytewords -i minimal -o hex lftpsptpcsihhsjziniaihtpsptpsolftpsptpcsihjzinjeihjktpsptpcsiaidjlidgegsftfn
5 | 82d8c8d81865616c696365d8c8d8c982d8c8d818656c696b6573d8c8d81863626f62
6 | DragonBook:~ ShannonA$ cbor2diag -x 82d8c8d81865616c696365d8c8d8c982d8c8d818656c696b6573d8c8d81863626f62
7 | [200(24("alice")), 200(201([200(24("likes")), 200(24("bob"))]))]
8 |
9 | EXPRESSIONS:
10 | https://github.com/BlockchainCommons/Gordian/blob/master/Envelope/Expressions.md
11 |
12 | UR TYPES:
13 | https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-006-urtypes.md
14 |
15 | FUNCTION/PARAMETER LISTING:
16 | https://github.com/BlockchainCommons/BCSwiftFoundation/blob/d410454bae8f6d460211b7bdd8c6ae2c539d2f0b/Sources/BCFoundation/Shared/FunctionExtensions.swift#L12
17 |
18 | ## Request Seed
19 | ur:envelope/lstpsptpcstptktaadethdcxaxtolansehsavteehpwdfxfmveihwewmkgtsmwkksksggtmnvttycpnnynuydmswtpsptpsolftpsptpsgcsietpsplftpsptpcstpttcsietpsptpsolftpsptpcstptdcssptpsptpcstaadeshdcxzmoycylumhmdgwspnyvadaktnsoycwmyaodihgftdllugltphlmtutytadosdwwdtpsptpsolftpsptpsgaatpsptpcsksiefdhsjpkpjncxjtkpjnjskphsjncxieiniajyhscxiejljzjljpihjncxinjtiainiekpjtjycxihkpjnclcxgykpinjkcxjskpinjkcxiejljzjljpihjkcxjkinjycxinjzjzjlcxiajljtjkihjskphsjykpjpcxjkinjycxkojljzkpjojyhsjyihjncxhskpjydmhesrdkts
20 |
21 | 83d8c8d818d8cfd90138582003ce809c31c2e0345bea433ee465edeb7bd79479c5ca4d8ee0d4229ef6db2ec6d8c8d8c982d8c8d8ca1864d8c882d8c8d818d8d11864d8c8d8c982d8c8d818d8d218c8d8c8d818d901395820ffa11a8b90954fc89ae625779ca11b8f0227573a2f8b4ed85d96ddf901a72cead8c8d8c982d8c8d8ca04d8c8d8187864486172756d206e756d7175616d20646963746120646f6c6f72656d20696e636964756e742065756d212051756973207175697320646f6c6f7265732073697420696c6c6f20636f6e73657175617475722073697420766f6c7570746174656d206175742e
22 |
23 | [200(24(207(312(h'03ce809c31c2e0345bea433ee465edeb7bd79479c5ca4d8ee0d4229ef6db2ec6')))),
24 | 200(201([200(202(100)), 200([200(24(209(100))), 200(201([200(24(210(200))), 200(24(313(h'ffa11a8b90954fc89ae625779ca11b8f0227573a2f8b4ed85d96ddf901a72cea')))]))])])),
25 | 200(201([200(202(4)), 200(24("Harum numquam dicta dolorem incidunt eum! Quis quis dolores sit illo consequatur sit voluptatem aut."))]))]
26 |
27 | ```
28 | 83 # array(3)
29 | D8 C8 # tag(200) ENVELOPE
30 | D8 18 # tag(24) BYTE STRING
31 | D8 CF # tag(207) REQUEST
32 | D9 0138 # tag(312) CID
33 | 58 20 # bytes(32)
34 | 03CE809C31C2E0345BEA433EE465EDEB7BD79479C5CA4D8EE0D4229EF6DB2EC6 # "\u0003\u0380\x9C1\xC2\xE04[\xEAC>\xE4e\xED\xEB{הy\xC5\xCAM\x8E\xE0\xD4\"\x9E\xF6\xDB.\xC6"
35 | D8 C8 # tag(200) ENVELOPE
36 | D8 C9 # tag(201) ASSERTION
37 | 82 # array(2)
38 | D8 C8 # tag(200) ENVELOPE
39 | D8 CA # tag(202) KNOWN VALUE
40 | 18 64 # unsigned(100) KV: BODY
41 | D8 C8 # tag(200) ENVELOPE
42 | 82 # array(2)
43 | D8 C8 # tag(200) ENVELOPE
44 | D8 18 # tag(24) BYTE STRING
45 | D8 D1 # tag(209) FUNCTION
46 | 18 64 # unsigned(100)
47 | D8 C8 # tag(200) ENVELOPE
48 | D8 C9 # tag(201) ASSERTION
49 | 82 # array(2)
50 | D8 C8 # tag(200) ENVELOPE
51 | D8 18 # tag(24) BYTE STRING
52 | D8 D2 # tag(210) PARAMETER
53 | 18 C8 # unsigned(200)
54 | D8 C8 # tag(200) ENVELOPE
55 | D8 18 # tag(24) BYTE STRING
56 | D9 0139 # tag(313) SEED DIGEST
57 | 58 20 # bytes(32)
58 | FFA11A8B90954FC89AE625779CA11B8F0227573A2F8B4ED85D96DDF901A72CEA # "\xFF\xA1\u001A\x8B\x90\x95OȚ\xE6%w\x9C\xA1\e\x8F\u0002'W:/\x8BN\xD8]\x96\xDD\xF9\u0001\xA7,\xEA"
59 | D8 C8 # tag(200) ENVELOPE
60 | D8 C9 # tag(201) ASSERTION
61 | 82 # array(2)
62 | D8 C8 # tag(200) ENVELOPE
63 | D8 CA # tag(202) KNOWN VALUE
64 | 04 # unsigned(4) KV: NOTE
65 | D8 C8 # tag(200) ENVELOPE
66 | D8 18 # tag(24) BYTE STRING
67 | 78 64 # text(100)
68 | 486172756D206E756D7175616D20646963746120646F6C6F72656D20696E636964756E742065756D212051756973207175697320646F6C6F7265732073697420696C6C6F20636F6E73657175617475722073697420766F6C7570746174656D206175742E # "Harum numquam dicta dolorem incidunt eum! Quis quis dolores sit illo consequatur sit voluptatem aut."
69 | ```
70 |
71 | ```
72 | request(CID(7370feae)) [
73 | body: «getKey» [
74 | ❰derivationPath❱: crypto-keypath(Map) [
75 | isA: derivationPath
76 | ]
77 | ]
78 | note: "Sint qui doloribus aperiam vel recusandae sit alias adipisci aut aliquid harum non. Nulla saepe provident illum sint autem ut consequatur fuga sapiente sint consectetur dolores?"
79 | ]
80 | ```
81 |
82 | ```mermaid
83 | graph LR
84 | 1(("73a74d84
NODE"))
85 | 2["7a0302af
request(CID(03ce809c))"]
86 | 3(["572491ba
ASSERTION"])
87 | 4[/"b2cbfa6b
100"/]
88 | 5(("c046590d
NODE"))
89 | 6["d44a14fe
«100»"]
90 | 7(["26b385ea
ASSERTION"])
91 | 8["a85815d7
❰200❱"]
92 | 9["43fa6f3d
313(Bytes(32))"]
93 | 10(["dfffc9e6
ASSERTION"])
94 | 11[/"49a5f41b
4"/]
95 | 12["5f515e27
#quot;Harum numquam dicta dolorem incidunt eum…#quot;"]
96 | 1 -->|subj| 2
97 | 1 --> 3
98 | 3 -->|pred| 4
99 | 3 -->|obj| 5
100 | 5 -->|subj| 6
101 | 5 --> 7
102 | 7 -->|pred| 8
103 | 7 -->|obj| 9
104 | 1 --> 10
105 | 10 -->|pred| 11
106 | 10 -->|obj| 12
107 | style 1 stroke:red,stroke-width:3.0px
108 | style 2 stroke:#55f,stroke-width:3.0px
109 | style 3 stroke:red,stroke-width:3.0px
110 | style 4 stroke:#55f,stroke-width:3.0px
111 | style 5 stroke:red,stroke-width:3.0px
112 | style 6 stroke:#55f,stroke-width:3.0px
113 | style 7 stroke:red,stroke-width:3.0px
114 | style 8 stroke:#55f,stroke-width:3.0px
115 | style 9 stroke:#55f,stroke-width:3.0px
116 | style 10 stroke:red,stroke-width:3.0px
117 | style 11 stroke:#55f,stroke-width:3.0px
118 | style 12 stroke:#55f,stroke-width:3.0px
119 | linkStyle 0 stroke:red,stroke-width:2.0px
120 | linkStyle 1 stroke-width:2.0px
121 | linkStyle 2 stroke:green,stroke-width:2.0px
122 | linkStyle 3 stroke:#55f,stroke-width:2.0px
123 | linkStyle 4 stroke:red,stroke-width:2.0px
124 | linkStyle 5 stroke-width:2.0px
125 | linkStyle 6 stroke:green,stroke-width:2.0px
126 | linkStyle 7 stroke:#55f,stroke-width:2.0px
127 | linkStyle 8 stroke-width:2.0px
128 | linkStyle 9 stroke:green,stroke-width:2.0px
129 | linkStyle 10 stroke:#55f,stroke-width:2.0px
130 | ```
131 |
132 |
133 |
134 | [Response Seed]
135 | ?
136 | ```
137 | response(CID(03ce809c)) [
138 | result: Bytes(16) [
139 | hasName: "Dark Purple Peck Vial"
140 | id: 200
141 | ]
142 | ]
143 | ```
144 |
145 | ```mermaid
146 | graph LR
147 | 1(("23f82a73
NODE"))
148 | 2["d07a8b9f
response(CID(03ce809c))"]
149 | 3(["ee94c24e
ASSERTION"])
150 | 4[/"4ee5b91c
101"/]
151 | 5(("9344f727
NODE"))
152 | 6["b6d2b918
Bytes(16)"]
153 | 7(["1be2074d
ASSERTION"])
154 | 8[/"9d0480e0
11"/]
155 | 9["03fcb27e
#quot;Dark Purple Peck Vial#quot;"]
156 | 10(["7894e935
ASSERTION"])
157 | 11[/"c2b87b29
1"/]
158 | 12[/"40d822c5
200"/]
159 | 1 -->|subj| 2
160 | 1 --> 3
161 | 3 -->|pred| 4
162 | 3 -->|obj| 5
163 | 5 -->|subj| 6
164 | 5 --> 7
165 | 7 -->|pred| 8
166 | 7 -->|obj| 9
167 | 5 --> 10
168 | 10 -->|pred| 11
169 | 10 -->|obj| 12
170 | style 1 stroke:red,stroke-width:3.0px
171 | style 2 stroke:#55f,stroke-width:3.0px
172 | style 3 stroke:red,stroke-width:3.0px
173 | style 4 stroke:#55f,stroke-width:3.0px
174 | style 5 stroke:red,stroke-width:3.0px
175 | style 6 stroke:#55f,stroke-width:3.0px
176 | style 7 stroke:red,stroke-width:3.0px
177 | style 8 stroke:#55f,stroke-width:3.0px
178 | style 9 stroke:#55f,stroke-width:3.0px
179 | style 10 stroke:red,stroke-width:3.0px
180 | style 11 stroke:#55f,stroke-width:3.0px
181 | style 12 stroke:#55f,stroke-width:3.0px
182 | linkStyle 0 stroke:red,stroke-width:2.0px
183 | linkStyle 1 stroke-width:2.0px
184 | linkStyle 2 stroke:green,stroke-width:2.0px
185 | linkStyle 3 stroke:#55f,stroke-width:2.0px
186 | linkStyle 4 stroke:red,stroke-width:2.0px
187 | linkStyle 5 stroke-width:2.0px
188 | linkStyle 6 stroke:green,stroke-width:2.0px
189 | linkStyle 7 stroke:#55f,stroke-width:2.0px
190 | linkStyle 8 stroke-width:2.0px
191 | linkStyle 9 stroke:green,stroke-width:2.0px
192 | linkStyle 10 stroke:#55f,stroke-width:2.0px
193 | ```
194 |
195 | ## Request Derivation
196 |
197 | ur:envelope/lstpsptpcstptktaadethdcxjkjozepladdliysbjnhnsertmnzolrspfslsroimeszefpfsledagmattaglgyentpsptpsolftpsptpsgcsietpsplftpsptpcstpttcsihtpsptpsolftpsptpcstptdcssotpsplftpsptpcstaaddyoeadlocsdyykaeykaeykaoykaxaatpsptpsolftpsptpsgadtpsptpsgcfadyntpsptpsolftpsptpsgaatpsptpcskspaguinjtjycxjskpincxiejljzjljpinidkpjkcxhsjoihjpinhsjncxkoihjzcxjpihiakpjkhsjtiehsihcxjkinjycxhsjzinhsjkcxhsieinjoinjkiaincxhskpjycxhsjzinjskpiniecxishsjpkpjncxjtjljtdmcxglkpjzjzhscxjkhsihjoihcxjojpjlkoinieihjtjycxinjzjzkpjncxjkinjtjycxhskpjyihjncxkpjycxiajljtjkihjskphsjykpjpcxiykpiohscxjkhsjoinihjtjyihcxjkinjtjycxiajljtjkihiajyihjykpjpcxiejljzjljpihjkfhuyghcedp
198 |
199 | ```
200 | 83 # array(3)
201 | D8 C8 # tag(200) ENVELOPE
202 | D8 18 # tag(24) BYTE STRING
203 | D8 CF # tag(207) REQUEST
204 | D9 0138 # tag(312)
205 | 58 20 # bytes(32)
206 | 7370FEAE012F66CB6D60C1C08EFB84C83D83B86A39FE413D8A255207D94E5136 # "sp\xFE\xAE\u0001/f\xCBm`\xC1\xC0\x8E\xFB\x84\xC8=\x83\xB8j9\xFEA=\x8A%R\a\xD9NQ6"
207 | D8 C8 # tag(200)
208 | D8 C9 # tag(201)
209 | 82 # array(2)
210 | D8 C8 # tag(200)
211 | D8 CA # tag(202)
212 | 18 64 # unsigned(100)
213 | D8 C8 # tag(200)
214 | 82 # array(2)
215 | D8 C8 # tag(200)
216 | D8 18 # tag(24)
217 | D8 D1 # tag(209)
218 | 18 65 # unsigned(101)
219 | D8 C8 # tag(200)
220 | D8 C9 # tag(201)
221 | 82 # array(2)
222 | D8 C8 # tag(200)
223 | D8 18 # tag(24)
224 | D8 D2 # tag(210)
225 | 18 C9 # unsigned(201)
226 | D8 C8 # tag(200)
227 | 82 # array(2)
228 | D8 C8 # tag(200)
229 | D8 18 # tag(24)
230 | D9 0130 # tag(304)
231 | A2 # map(2)
232 | 01 # unsigned(1)
233 | 88 # array(8)
234 | 18 30 # unsigned(48)
235 | F5 # primitive(21)
236 | 00 # unsigned(0)
237 | F5 # primitive(21)
238 | 00 # unsigned(0)
239 | F5 # primitive(21)
240 | 02 # unsigned(2)
241 | F5 # primitive(21)
242 | 03 # unsigned(3)
243 | 04 # unsigned(4)
244 | D8 C8 # tag(200)
245 | D8 C9 # tag(201)
246 | 82 # array(2)
247 | D8 C8 # tag(200)
248 | D8 CA # tag(202)
249 | 01 # unsigned(1)
250 | D8 C8 # tag(200)
251 | D8 CA # tag(202)
252 | 19 01F6 # unsigned(502)
253 | D8 C8 # tag(200)
254 | D8 C9 # tag(201)
255 | 82 # array(2)
256 | D8 C8 # tag(200)
257 | D8 CA # tag(202)
258 | 04 # unsigned(4)
259 | D8 C8 # tag(200)
260 | D8 18 # tag(24)
261 | 78 B1 # text(177)
262 | 53696E742071756920646F6C6F7269627573206170657269616D2076656C207265637573616E6461652073697420616C6961732061646970697363692061757420616C697175696420686172756D206E6F6E2E204E756C6C612073616570652070726F766964656E7420696C6C756D2073696E7420617574656D20757420636F6E736571756174757220667567612073617069656E74652073696E7420636F6E736563746574757220646F6C6F7265733F # "Sint qui doloribus aperiam vel recusandae sit alias adipisci aut aliquid harum non. Nulla saepe provident illum sint autem ut consequatur fuga sapiente sint consectetur dolores?"
263 |
264 | ```
265 | ```
266 | request(CID(7370feae)) [
267 | body: «getKey» [
268 | ❰derivationPath❱: crypto-keypath(Map) [
269 | isA: derivationPath
270 | ]
271 | ]
272 | note: "Sint qui doloribus aperiam vel recusandae sit alias adipisci aut aliquid harum non. Nulla saepe provident illum sint autem ut consequatur fuga sapiente sint consectetur dolores?"
273 | ]
274 | ```
275 |
276 | ```mermaid
277 | graph LR
278 | 1(("d477fb1b
NODE"))
279 | 2["b943b664
request(CID(7370feae))"]
280 | 3(["2d2ff06c
ASSERTION"])
281 | 4[/"b2cbfa6b
100"/]
282 | 5(("020d6d55
NODE"))
283 | 6["6f69ae4f
«101»"]
284 | 7(["ea2181cc
ASSERTION"])
285 | 8["8ab2a2ba
❰201❱"]
286 | 9(("54810b5b
NODE"))
287 | 10["f627e959
304(Map)"]
288 | 11(["76bbe79a
ASSERTION"])
289 | 12[/"c2b87b29
1"/]
290 | 13[/"80a261b4
502"/]
291 | 14(["61c8768c
ASSERTION"])
292 | 15[/"49a5f41b
4"/]
293 | 16["4fc181b0
#quot;Sint qui doloribus aperiam vel recusanda…#quot;"]
294 | 1 -->|subj| 2
295 | 1 --> 3
296 | 3 -->|pred| 4
297 | 3 -->|obj| 5
298 | 5 -->|subj| 6
299 | 5 --> 7
300 | 7 -->|pred| 8
301 | 7 -->|obj| 9
302 | 9 -->|subj| 10
303 | 9 --> 11
304 | 11 -->|pred| 12
305 | 11 -->|obj| 13
306 | 1 --> 14
307 | 14 -->|pred| 15
308 | 14 -->|obj| 16
309 | style 1 stroke:red,stroke-width:3.0px
310 | style 2 stroke:#55f,stroke-width:3.0px
311 | style 3 stroke:red,stroke-width:3.0px
312 | style 4 stroke:#55f,stroke-width:3.0px
313 | style 5 stroke:red,stroke-width:3.0px
314 | style 6 stroke:#55f,stroke-width:3.0px
315 | style 7 stroke:red,stroke-width:3.0px
316 | style 8 stroke:#55f,stroke-width:3.0px
317 | style 9 stroke:red,stroke-width:3.0px
318 | style 10 stroke:#55f,stroke-width:3.0px
319 | style 11 stroke:red,stroke-width:3.0px
320 | style 12 stroke:#55f,stroke-width:3.0px
321 | style 13 stroke:#55f,stroke-width:3.0px
322 | style 14 stroke:red,stroke-width:3.0px
323 | style 15 stroke:#55f,stroke-width:3.0px
324 | style 16 stroke:#55f,stroke-width:3.0px
325 | linkStyle 0 stroke:red,stroke-width:2.0px
326 | linkStyle 1 stroke-width:2.0px
327 | linkStyle 2 stroke:green,stroke-width:2.0px
328 | linkStyle 3 stroke:#55f,stroke-width:2.0px
329 | linkStyle 4 stroke:red,stroke-width:2.0px
330 | linkStyle 5 stroke-width:2.0px
331 | linkStyle 6 stroke:green,stroke-width:2.0px
332 | linkStyle 7 stroke:#55f,stroke-width:2.0px
333 | linkStyle 8 stroke:red,stroke-width:2.0px
334 | linkStyle 9 stroke-width:2.0px
335 | linkStyle 10 stroke:green,stroke-width:2.0px
336 | linkStyle 11 stroke:#55f,stroke-width:2.0px
337 | linkStyle 12 stroke-width:2.0px
338 | linkStyle 13 stroke:green,stroke-width:2.0px
339 | linkStyle 14 stroke:#55f,stroke-width:2.0px
340 | ```
341 |
342 | ## Request Key
343 |
344 | ```
345 | request(CID(c1e3a73a)) [
346 | body: «101» [
347 | ❰201❱: crypto-keypath(Map) [
348 | id: 502
349 | ]
350 | ]
351 | note: "Voluptates omnis voluptates accusamus. Sed aliquam perspiciatis rem veniam commodi harum sequi atque enim est et ab accusantium consequuntur voluptas."
352 | ]
353 | ```
354 |
355 | ```mermaid
356 | graph LR
357 | 1(("b5c53e80
NODE"))
358 | 2["288a38af
request(CID(c1e3a73a))"]
359 | 3(["990edd80
ASSERTION"])
360 | 4[/"49a5f41b
4"/]
361 | 5["cfa7df7c
#quot;Voluptates omnis voluptates accusamus. S…#quot;"]
362 | 6(["a59cb7f4
ASSERTION"])
363 | 7[/"b2cbfa6b
100"/]
364 | 8(("713666dd
NODE"))
365 | 9["6f69ae4f
«101»"]
366 | 10(["90bba300
ASSERTION"])
367 | 11["8ab2a2ba
❰201❱"]
368 | 12(("760d94cb
NODE"))
369 | 13["640ef0d1
304(Map)"]
370 | 14(["76bbe79a
ASSERTION"])
371 | 15[/"c2b87b29
1"/]
372 | 16[/"80a261b4
502"/]
373 | 1 -->|subj| 2
374 | 1 --> 3
375 | 3 -->|pred| 4
376 | 3 -->|obj| 5
377 | 1 --> 6
378 | 6 -->|pred| 7
379 | 6 -->|obj| 8
380 | 8 -->|subj| 9
381 | 8 --> 10
382 | 10 -->|pred| 11
383 | 10 -->|obj| 12
384 | 12 -->|subj| 13
385 | 12 --> 14
386 | 14 -->|pred| 15
387 | 14 -->|obj| 16
388 | style 1 stroke:red,stroke-width:3.0px
389 | style 2 stroke:#55f,stroke-width:3.0px
390 | style 3 stroke:red,stroke-width:3.0px
391 | style 4 stroke:#55f,stroke-width:3.0px
392 | style 5 stroke:#55f,stroke-width:3.0px
393 | style 6 stroke:red,stroke-width:3.0px
394 | style 7 stroke:#55f,stroke-width:3.0px
395 | style 8 stroke:red,stroke-width:3.0px
396 | style 9 stroke:#55f,stroke-width:3.0px
397 | style 10 stroke:red,stroke-width:3.0px
398 | style 11 stroke:#55f,stroke-width:3.0px
399 | style 12 stroke:red,stroke-width:3.0px
400 | style 13 stroke:#55f,stroke-width:3.0px
401 | style 14 stroke:red,stroke-width:3.0px
402 | style 15 stroke:#55f,stroke-width:3.0px
403 | style 16 stroke:#55f,stroke-width:3.0px
404 | linkStyle 0 stroke:red,stroke-width:2.0px
405 | linkStyle 1 stroke-width:2.0px
406 | linkStyle 2 stroke:green,stroke-width:2.0px
407 | linkStyle 3 stroke:#55f,stroke-width:2.0px
408 | linkStyle 4 stroke-width:2.0px
409 | linkStyle 5 stroke:green,stroke-width:2.0px
410 | linkStyle 6 stroke:#55f,stroke-width:2.0px
411 | linkStyle 7 stroke:red,stroke-width:2.0px
412 | linkStyle 8 stroke-width:2.0px
413 | linkStyle 9 stroke:green,stroke-width:2.0px
414 | linkStyle 10 stroke:#55f,stroke-width:2.0px
415 | linkStyle 11 stroke:red,stroke-width:2.0px
416 | linkStyle 12 stroke-width:2.0px
417 | linkStyle 13 stroke:green,stroke-width:2.0px
418 | linkStyle 14 stroke:#55f,stroke-width:2.0px
419 | ```
420 |
--------------------------------------------------------------------------------
/Docs/ur-overview.md:
--------------------------------------------------------------------------------
1 | # UR Overview
2 |
3 | UR stands for Uniform Resources, a method for encoding structured binary data in plain-text strings that are also well-formed URIs. It's an interoperability specification that allows for the reliable, typed transfer of data and was designed in particular to allow for reliable transmission of crypto-seeds, crypto-keys, PSBTs, and other data related to cryptocurrency.
4 |
5 | One of the particular advantages of UR is careful integration with QR codes, a prime method for transmitting data across airgaps. URs are built to be efficient when encoded as QRs. In addition, multi-part URs allow for the creation of animated QRs, overall containing more information than any single QR could have.
6 |
7 | Typed data, reliable interoperation, QR optimization, and animated QRs are the main reasons to use the UR specification.
8 |
9 | ## Intro
10 |
11 | The following provides broad overviews of UR:
12 |
13 | * [UR High Level Overview](https://www.blockchaincommons.com/projects/Blockchain-Commons-URs-Support-Airgapped-PSBTs/)
14 | * [UR Technology Introduction](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/ur-1-overview.md)
15 |
16 | These videos offer overviews in a different format:
17 |
18 | * [URs in Technology Overview Video](https://www.youtube.com/watch?v=RYgOFSdUqWY&t=1198s)
19 | * [Multi-part URs in Technology Overview Video](https://www.youtube.com/watch?v=RYgOFSdUqWY&t=1373s)
20 | * [UR Types in Technology Overview Video](https://www.youtube.com/watch?v=RYgOFSdUqWY&t=1464s)
21 |
22 | ## For Users
23 |
24 | As a user, you might note applications using URs of the format "ur:type/bytewords" (or a QR encoding that UR). These allow for the free movement of data among apps that support the UR specification. This will be mostly automated, typically requiring you to show a QR from one app to another.
25 |
26 | Example UR:
27 | ```
28 | ur:crypto-seed/oyadgdhkwzdtfthptokigtvwnnjsqzcxknsktdhpyljeda
29 | ```
30 |
31 |
32 |
33 |
34 |
35 |
36 |
QR Tool (deprecated) Recognition
37 | |
38 |
39 |
40 |
Seed Tool Exports
41 | |
42 |
43 |
44 |
Seed Tool SSKR
45 | |
46 |
47 |
48 |
49 | The following iOS reference applications support the use of URs:
50 |
51 | * [Gordian Seed Tool](https://apps.apple.com/us/app/gordian-seed-tool/id1545088229) — imports and exports URs
52 |
53 | ## For Developers
54 |
55 | The following are accessible guides to using URs in your programs:
56 |
57 | * [URs: An Introduction](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/ur-1-overview.md)
58 | * [A Guide to URs for PSBTs](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/ur-4-psbt.md)
59 | * [A Guide to URs for Key Material](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/ur-2-keys.md)
60 | * [A Guide to URs for SSKRs](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/ur-3-sskrs.md)
61 | * [A Guide to UR Request & Response](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/ur-99-request-response.md) [**Deprecated**]
62 | * [crypto-request and crypto-response vs Signing via crypto-psbt](crypto-request-or-crypto-psbt.md)
63 |
64 | They are based on the following, original definitional research papers:
65 |
66 | * [BCR-2020-005: Uniform Resources (UR): Encoding Structured Binary Data for Transport in URIs and QR Codes](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md)
67 | * [BCR-2020-006: Registry of Uniform Resource (UR) Types](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-006-urtypes.md)
68 | * [BCR-2020-007: UR Type Definition for Hierarchical Deterministic (HD)](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-007-hdkey.md)
69 | * [BCR-2020-008: UR Type Definition for Elliptic Curve (EC) Keys](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-008-eckey.md)
70 | * [BCR-2020-009: UR Type Definition for Cryptocurrency Addresses](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-009-address.md)
71 | * [BCR-2020-010: UR Type Definition for Bitcoin Output Descriptors](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-010-output-desc.md)
72 | * [BCR-2020-011: UR Type Definition for Sharded Secret Key Reconstruction (SSKR)](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-011-sskr.md)
73 | * [BCR-2020-014: URs on E-paper display](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-014-urs-on-epaper.md)
74 | * [BCR-2020-015: UR Type Definition for BIP44 Accounts](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-015-account.md)
75 | * [BCR-2021-001: UR Type Definitions for Transactions Between Airgapped Devices](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2021-001-request.md)
76 |
77 | ### Animated QRs
78 |
79 | One of the important aspects of URs was that they allowed for the introduction of Animated QRs. These are crucial for airgapped architectures because they allow the transmission of PSBTs over an airgap.
80 |
81 | 1. [Animated QRs](https://www.blockchaincommons.com/devs/animated-qrs.html)
82 | 1. [Animated QRs Video](https://www.youtube.com/watch?v=HsFF5HPKQIk)
83 |
84 | ## Code
85 |
86 | The following Blockchain Commons libraries support the usage of URs:
87 |
88 | * [bc-ur](https://github.com/BlockchainCommons/bc-ur) — C++ reference library
89 | * [bc-ur-java](https://github.com/BlockchainCommons/bc-ur-java) — Java reference library
90 | * [URKit](https://github.com/BlockchainCommons/URKit) and [URUI](https://github.com/BlockchainCommons/URUI) — Swift libraries for usage and display of URs.
91 |
92 | The following third-party libraries support URs in a variety of languages:
93 |
94 | * [Hummingbird](https://github.com/sparrowwallet/hummingbird) — Another Java library
95 | * [foundation-ur-py](https://github.com/Foundation-Devices/foundation-ur-py) — Python library
96 | * [ur-rs](https://github.com/dspicher/ur-rs) — Rust library
97 |
98 | ### Reference Tools
99 |
100 | Want to verify your code? That's what the Blockchain Commons reference tools are for.
101 |
102 | * [seedtool-cli - Cryptographic Seed Tool for the command line](https://github.com/BlockchainCommons/seedtool-cli)
103 | * [Gordian Seed Tool iOS - Cryptographic Seed Manager for iOS & Mac](https://github.com/BlockchainCommons/GordianSeedTool-iOS)
104 |
105 | ## Support
106 |
107 | To support the continued creation and growth of specifications such as this, please become a sponsor of Blockchain Commons, either through [GitHub](https://github.com/sponsors/BlockchainCommons) or through Bitcoin donations on our [BTCpay](https://btcpay.blockchaincommons.com/). Thank you to our [sustaining and additional sponsors](https://www.blockchaincommons.com/sponsors.html).
108 |
109 | Please also join us in our [Airgapped Wallet Community](https://github.com/BlockchainCommons/Airgapped-Wallet-Community/discussions) where we are discussing and advancing this and other specifications.
110 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Unless otherwise noted (either in /README.md or in the file's header comments) the contents of this repository are released under the following license:
2 |
3 | BSD-2-Clause Plus Patent License
4 |
5 | SPDX-License-Identifier: [BSD-2-Clause-Patent](https://spdx.org/licenses/BSD-2-Clause-Patent.html)
6 |
7 | Copyright © 2019 Blockchain Commons, LLC
8 |
9 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
10 |
11 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
12 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
13 | Subject to the terms and conditions of this license, each copyright holder and contributor hereby grants to those receiving rights under this license a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except for failure to satisfy the conditions of this license) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer this software, where such license applies only to those patent claims, already acquired or hereafter acquired, licensable by such copyright holder or contributor that are necessarily infringed by:
14 |
15 | (a) their Contribution(s) (the licensed copyrights of copyright holders and non-copyrightable additions of contributors, in source or binary form) alone; or
16 | (b) combination of their Contribution(s) with the work of authorship to which such Contribution(s) was added by such copyright holder or contributor, if, at the time the Contribution is added, such addition causes such combination to be necessarily infringed. The patent license shall not apply to any other combinations which include the Contribution.
17 | Except as expressly stated above, no rights or licenses from any copyright holder or contributor is granted under this license, whether expressly, by implication, estoppel or otherwise.
18 |
19 | DISCLAIMER
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | ### _by Wolf McNally and Christopher Allen_
4 |
5 | _Crypto Commons is the Gordian reference code & CLI utilities. It collects together all of Blockchain Commons' wallet libraries and the utilities built from them._
6 |
7 | It includes reference libraries (mostly in C), which can be used to build wallets; and demos & tools, which exercise and exemplify those wallet libraries.
8 |
9 | ## Documents
10 |
11 | _See the [complete listing](Docs/README.md)._
12 |
13 | ### SSKR
14 |
15 | 1. **[SSKR for Users](Docs/sskr-users.md)**
16 | * **[SSKR Cold Storage](Docs/sskr-cold-storage.md)**
17 | * **[SSKR Video Example](Docs/sskr-video.md)**
18 | 1. **[SSKR for Developers](Docs/sskr-developers.md)**
19 | * **[SSKR Test Vector](Docs/sskr-test-vector.md)**
20 |
21 | ### URs
22 |
23 | 1. **[URs: An Overview](Docs/ur-1-overview.md)**
24 | * **[A Guide to Using URs for PSBTs](Docs/ur-4-psbt.md)** [our biggest success story]
25 | * **[A Guide to Using URs for Key Material](Docs/ur-2-keys.md)**
26 | * **[A Guide to Using URs for SSKRs](Docs/ur-3-sskrs.md)**
27 | * **[A Guide to Using UR Request & Response](Docs/ur-99-request-response.md)**
28 | 1. **[crypto-request and crypto-response vs Signing via crypto-psbt](Docs/crypto-request-or-crypto-psbt.md)**
29 | 1. **[crypto-request test vectors](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/crypto-request-test-vectors.md)**
30 | 1. **[crypto-seed test vectors](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/crypto-seed-test-vectors.md)**
31 | 1. **[Animated QRs](https://www.blockchaincommons.com/devs/animated-qrs.html)**
32 | 1. **[Animated QRs Video](https://www.youtube.com/watch?v=HsFF5HPKQIk)**
33 |
34 | ### Envelopes (Videos)
35 |
36 | 1. **[Envelope Introduction](https://www.youtube.com/watch?v=OcnpYqHn8NQ)**
37 | 1. **[Envelope Overview](https://www.youtube.com/watch?v=K2gFTyjbiYk)**
38 | 1. **[Envelope & SSKR](https://www.youtube.com/watch?v=ERRhMDSEFm8)**
39 | * **[Seed Tool & SSKR](https://www.youtube.com/watch?v=aciTNh402Co)**
40 | 1. **[Envelope MVA](https://www.youtube.com/watch?v=S0deyIHXukk)**
41 | 1. **[Envelope Non-Correlation & Elision](https://www.youtube.com/watch?v=ubqKJAizayU)**
42 | 1. **[Envelope-CLI](https://www.youtube.com/watch?v=JowheoEIGmE)**
43 | 1. **[Envelope-CLI Q&A](https://www.youtube.com/watch?v=2MjcrKLEsSE)**
44 |
45 | ### Video Overview
46 |
47 |
48 |
49 | ## Gordian Tools & Demos
50 |
51 | _Blockchain Commons has released a number of kits and CLI tools that exercise the Gordian reference libraries._
52 |
53 | * **[Bytewords](https://github.com/BlockchainCommons/bc-bytewords-cli) \(CLI\).** A tool for testing bytewords.
54 | * _Exercises [bc-crypto-base](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-crypto-base) and [bc-bytewords](https://github.com/blockchaincommons/bc-bytewords)._
55 | * **[dCBOR](https://github.com/BlockchainCommons/dcbor-cli) \(CLI\).** A tool for parsing & validating deterministic CBOR.
56 | * _Exercises [bc-dcbor-rust](https://github.com/BlockchainCommons/bc-dcbor-rust)._
57 | * **[Keytool](https://github.com/BlockchainCommons/bc-keytool-cli) \(CLI\).** A tool for deriving keys and addresses from seeds.
58 | * _Uses [bc-crypto-base](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-crypto-base)._
59 | * **[LetheKit](https://github.com/BlockchainCommons/bc-lethekit) \(Hardware Kit\).** A do-it-yourself hardware kit for generating and translating seeds in an airgapped manner. Cotains its own version of seedtool built using the Arduino IDE.
60 | * _LetheKit's Seedtool exercises [bc-crypto-base](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-crypto-base), [bc-bip-39](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-bip-39), [bc-bytewords](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-bytewords), [bc-shamir](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-shamir), [bc-sskr](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-sskr), and [bc-ur](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-ur) (the last through a bc-ur-arduino port)._
61 | * **[LifeHashTool](https://github.com/BlockchainCommons/LifeHashTool) \(Swift CLI\).** A tool for generating Lifehash PNGs from the command line.
62 | * _LifeHashTool uses [LifeHash](https://github.com/BlockchainCommons/LifeHash)._
63 | * **[Seedtool](https://github.com/BlockchainCommons/bc-seedtool-cli) \(CLI\).** A tool for generating seeds from a variety of random inputs and for translating seeds among formats like BIP39, [SSKR](https://github.com/blockchaincommons/bc-sskr), hex, and [Bytewords](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-012-bytewords.md).
64 | * _Exercises [bc-crypto-base](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-crypto-base), [bc-bip-39](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-bip-39), [bc-shamir](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-shamir), [bc-sskr](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-sskr), and [bc-ur](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-ur)._
65 | * **[URDemo](https://github.com/BlockchainCommons/URDemo) \(iOS Demo\).** A demonstration of the [URKit](https://github.com/BlockchainCommons/crypto-commons/blob/master/README.md#bc-ur) that can be compiled and run in Xcode using Swift. It demonstrates multi-part animated QRs.
66 |
67 | See also our [Gordian repo](https://github.com/BlockchainCommons/Gordian/blob/master/README.md#quick-links-for-reference-apps) for our complete list of reference apps, including other CLIs, mobile apps, and web servers.
68 |
69 | ## Gordian Reference Libraries
70 |
71 | _The Crypto Commons libraries are reference implementations, meant to be examples of how to standardly implement these various crypto functions._
72 |
73 | ### *bc-crypto-base*
74 |
75 | _Well-reviewed, audited, and optimized crypto functions. Includes CRC32, HMAC-SHA-256, HMAC-SHA-512, PBKDF2-SHA-256, PBKDF2-SHA-512, SHA-256, and SHA-512 algorithms, and memzero functions._
76 |
77 | | Language | Repo | Contributor | Status |
78 | |----------|------|-------------|--------|
79 | | C | [bc-crypto-base](https://github.com/BlockchainCommons/bc-crypto-base) | Blockchain Commons |
80 | | Java | [bc-libs-java](https://github.com/BlockchainCommons/bc-libs-java) | Bitmark |
81 | | Rust | [bc-crypto-rust](https://github.com/BlockchainCommons/bc-crypto-rust) | Blockchain Commons |
82 | | Swift | [BCLibsSwift](https://github.com/BlockchainCommons/BCLibsSwift) | Blockchain Commons |
83 |
84 | ### *bc-bech32*
85 |
86 | **Specification:** [BIP-173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki)
87 |
88 | _Implementation of Bech32 address format. No longer being actively supported._
89 |
90 | | Language | Repo | Contributor | Status |
91 | |----------|------|-------------|--------|
92 | | C | [bc-bech32](https://github.com/BlockchainCommons/bc-bech32) | Blockchain Commons | Unsupported |
93 |
94 | ### *bc-bip-39*
95 |
96 | **Specification:** [BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki)
97 |
98 | _Implementation of BIP-39 mnemonic codes._
99 |
100 | | Language | Repo | Contributor | Status |
101 | |----------|------|-------------|--------|
102 | | C | [bc-bip39](https://github.com/blockchaincommons/bc-bip39) | Blockchain Commons | |
103 | | Java | [bc-libs-java](https://github.com/BlockchainCommons/bc-libs-java) | Bitmark |
104 |
105 | ### *bc-bytewords*
106 |
107 | **Specification:** [bcr-2020-012](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-012-bytewords.md)
108 |
109 | _The Bytewords methodology encodes binary data as English words, using a set of 256 four-letter words, each of which can be recovering using just the first two letters. Bytewords are also used in [bc-sskr](https://github.com/blockchaincommons/bc-sskr) and [bc-ur](https://github.com/BlockchainCommons/bc-ur)._
110 |
111 | | Language | Repo | Contributor | Status |
112 | |----------|------|-------------|--------|
113 | | C | [bc-bytewords](https://github.com/BlockchainCommons/bc-bytewords) | Blockchain Commons | |
114 | | Java | [bc-libs-java](https://github.com/BlockchainCommons/bc-libs-java) | Bitmark |
115 |
116 |
117 | ### *bc-dcbor*
118 |
119 | **Specification:** [RFC8949](https://www.rfc-editor.org/rfc/rfc8949.html) / [dCBOR I-D](https://datatracker.ietf.org/doc/draft-mcnally-deterministic-cbor/)
120 |
121 | _Libraries for CBOR compliant with the [deterministic options](https://www.rfc-editor.org/rfc/rfc8949.html#name-deterministically-encoded-c). For more, see our [dCBOR page](dcbor.md)._
122 |
123 | | Language | Repo | Contributor | Status |
124 | |----------|------|-------------|--------|
125 | | Rust | [bc-dcbor-rust](https://github.com/BlockchainCommons/bc-dcbor-rust) | Blockchain Commons | |
126 | | Swift | [BCSwiftDCBOR](https://github.com/BlockchainCommons/BCSwiftDCBOR) | Blockchain Commons | |
127 |
128 |
129 | ### *bc-envelope*
130 |
131 | **Specification:** [Envelope Structured Data Format I-D](https://datatracker.ietf.org/doc/draft-mcnally-envelope/)
132 |
133 | _Libraries for [Gordian Envelope](https://www.blockchaincommons.com/introduction/Envelope-Intro/)._
134 |
135 | | Language | Repo | Contributor | Status |
136 | |----------|------|-------------|--------|
137 | | Rust | [bc-envelope-rust](https://github.com/BlockchainCommons/bc-envelope-rust) | Blockchain Commons | |
138 | | Swift | [BCSwiftEnvelope](https://github.com/BlockchainCommons/BCSwiftEnvelope) | Blockchain Commons | |
139 |
140 |
141 | ### *bc-lifehash*
142 |
143 | **Overview:** [Lifehash.info](https://github.com/BlockchainCommons/lifehash.info)
144 |
145 | _A library for creating LifeHash visual hashes._
146 |
147 | | Language | Repo | Contributor | Status |
148 | |----------|------|-------------|--------|
149 | | C/C++ | [bc-lifehash](https://github.com/BlockchainCommons/bc-lifehash) | Blockchain Commons |
150 | | Python | [bc-lifehash-python](https://github.com/BlockchainCommons/bc-lifehash-python) | CrossBar |
151 | | Swift | [LifeHash](https://github.com/BlockchainCommons/LifeHash) | Blockchain Commons |
152 |
153 | ### *bc-shamir*
154 |
155 | **Specification:** ["How to Share a Secret"](https://dl.acm.org/doi/pdf/10.1145/359168.359176)
156 |
157 | _Implementation of Shamir's Secret Sharing._
158 |
159 | | Language | Repo | Contributor | Status |
160 | |----------|------|-------------|--------|
161 | | C | [bc-shamir](https://github.com/BlockchainCommons/bc-shamir) | Blockchain Commons | [Security Reviewed](https://github.com/BlockchainCommons/bc-shamir/blob/master/SECURITY-REVIEW.md) |
162 | | Java | [bc-libs-java](https://github.com/BlockchainCommons/bc-libs-java) | Bitmark |
163 | | Rust | [bc-shamir-rust](https://github.com/BlockchainCommons/bc-shamir-rust) | Blockchain Commons |
164 | | Swift | [BCLibsSwift](https://github.com/BlockchainCommons/BCLibsSwift) | Blockchain Commons |
165 |
166 | ### *bc-slip39*
167 |
168 | **Specification:** [SLIP-39](https://github.com/satoshilabs/slips/blob/master/slip-0039.md).
169 |
170 | _Implementation of Satoshi Labs' SLIP-39. Largely deprected due to discovery of [round-trip failure with BIP-39](https://github.com/BlockchainCommons/bc-lethekit/issues/38). Blockchain Commons projects use [bc-sskr](https://github.com/blockchaincommons/bc-sskr) instead._
171 |
172 | | Language | Repo | Contributor | Status |
173 | |----------|------|-------------|--------|
174 | | C | [bc-slip39](https://github.com/BlockchainCommons/bc-slip39) | Blockchain Commons | Deprecated |
175 |
176 | ### *bc-sskr*
177 |
178 | **Specification:** [bcr-2020-011](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-011-sskr.md)
179 |
180 | _The SSKR (Sharded Secret Key Reconstruction) methodology is an alternative to SLIP-39 that converts Shamir shares to [URs](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-012-bytewords.md) or [bytewords](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-012-bytewords.md). Its main improvement over SLIP-39 is that it round trips with BIP-39, whereas [SLIP-39 does not](https://github.com/BlockchainCommons/bc-lethekit/issues/38)._
181 |
182 | | Language | Repo | Contributor | Status |
183 | |----------|------|-------------|--------|
184 | | C | [bc-sskr](https://github.com/blockchaincommons/bc-sskr) | Blockchain Commons | [Security Reviewed](https://github.com/BlockchainCommons/bc-sskr/blob/master/SECURITY-REVIEW.md) |
185 | | Java | [bc-libs-java](https://github.com/BlockchainCommons/bc-libs-java) | Bitmark |
186 | | JavaCard | [jc-sskr](https://github.com/proxyco/jc-sskr) | Proxy |
187 | | Rust | [bc-sskr-rust](https://github.com/BlockchainCommons/bc-sskr-rust) | Blockchain Commons |
188 | | Swift | [BCLibsSwift](https://github.com/BlockchainCommons/BCLibsSwift) | Blockchain Commons |
189 |
190 | ### *bc-ur*
191 |
192 | **Specification:** [bcr-2020-005](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md)
193 |
194 | _The UR methodology allows the encoding of binary data of arbitrary content and length and their transportation using one or more URIs or QR codes (or alternatively animated QR codes). It also integrates with [bytewords](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-012-bytewords.md)._
195 |
196 | | Language | Repo | Contributor | Status |
197 | |----------|------|-------------|--------|
198 | | C++ | [bc-ur](https://github.com/BlockchainCommons/bc-ur) | Blockchain Commons |
199 | | Java | [bc-ur-java](https://github.com/BlockchainCommons/bc-ur-java) | Bitmark |
200 | | Java | [Hummingbird](https://github.com/sparrowwallet/hummingbird) | Craig Raw |
201 | | Python | [foundation-ur-py](https://github.com/Foundation-Devices/foundation-ur-py) | Foundation |
202 | | Rust | [bc-ur-rust](https://github.com/BlockchainCommons/bc-ur-rust) | Blockchain Commons |
203 | | Rust | [ur-rust](https://github.com/dspicher/ur-rs) | Dominik Spicher |
204 | | Swift | [URKit](https://github.com/BlockchainCommons/URKit) + [URUI](https://github.com/BlockchainCommons/URUI) | Blockchain Commons |
205 |
206 | ## Third-Party Libraries
207 |
208 | Blockchain Commons also uses well-supported libraries from third parties. In particular, we make strong usage of The Elements Project [libwally wallet library](https://github.com/ElementsProject/libwally-core). We are further supporting it with wrappers for [Swift](https://github.com/BlockchainCommons/BCLibwallySwift) and [Java](https://github.com/BlockchainCommons/bc-bclibwally-java).
209 |
210 | ## Status - Varied
211 |
212 | Please see individual projects for their exact status. The C libraries are largely in feature-complete beta status.
213 |
214 | ## Origin, Authors, Copyright & Licenses
215 |
216 | Unless otherwise noted (either in this [/README.md](./README.md) or in the file's header comments) the contents of this repository are Copyright © 2020 by Blockchain Commons, LLC, and are [licensed](./LICENSE) under the [spdx:BSD-2-Clause Plus Patent License](https://spdx.org/licenses/BSD-2-Clause-Patent.html).
217 |
218 | In most cases, the authors, copyright, and license for each file reside in header comments in the source code. When it does not, we have attempted to attribute it accurately in the table below.
219 |
220 | ## Financial Support
221 |
222 | Crypto Commons is a project of [Blockchain Commons](https://www.blockchaincommons.com/). We are proudly a "not-for-profit" social benefit corporation committed to open source & open development. Our work is funded entirely by donations and collaborative partnerships with people like you. Every contribution will be spent on building open tools, technologies, and techniques that sustain and advance blockchain and internet security infrastructure and promote an open web.
223 |
224 | To financially support further development of Crypto Commons and other projects, please consider becoming a Patron of Blockchain Commons through ongoing monthly patronage as a [GitHub Sponsor](https://github.com/sponsors/BlockchainCommons). You can also support Blockchain Commons with bitcoins at our [BTCPay Server](https://btcpay.blockchaincommons.com/).
225 |
226 | ## Contributing
227 |
228 | We encourage public contributions through issues and pull requests! Please review [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our development process. All contributions to this repository require a GPG signed [Contributor License Agreement](./CLA.md).
229 |
230 | ### Discussions
231 |
232 | The best place to talk about Blockchain Commons and its projects is in our GitHub Discussions areas.
233 |
234 | [**Gordian Developer Community**](https://github.com/BlockchainCommons/Gordian-Developer-Community/discussions). For standards and open-source developers who want to talk about interoperable wallet specifications, please use the Discussions area of the [Gordian Developer Community repo](https://github.com/BlockchainCommons/Gordian-Developer-Community/discussions). This is where you talk about Gordian specifications such as [Gordian Envelope](https://github.com/BlockchainCommons/Gordian/tree/master/Envelope#articles), [bc-shamir](https://github.com/BlockchainCommons/bc-shamir), [Sharded Secret Key Reconstruction](https://github.com/BlockchainCommons/bc-sskr), and [bc-ur](https://github.com/BlockchainCommons/bc-ur) as well as the larger [Gordian Architecture](https://github.com/BlockchainCommons/Gordian/blob/master/Docs/Overview-Architecture.md), its [Principles](https://github.com/BlockchainCommons/Gordian#gordian-principles) of independence, privacy, resilience, and openness, and its macro-architectural ideas such as functional partition (including airgapping, the original name of this community).
235 |
236 | [**Blockchain Commons Discussions**](https://github.com/BlockchainCommons/Community/discussions). For developers, interns, and patrons of Blockchain Commons, please use the discussions area of the [Community repo](https://github.com/BlockchainCommons/Community) to talk about general Blockchain Commons issues, the intern program, or topics other than those covered by the [Gordian Developer Community](https://github.com/BlockchainCommons/Gordian-Developer-Community/discussions) or the
237 | [Gordian User Community](https://github.com/BlockchainCommons/Gordian/discussions).### Other Questions & Problems
238 |
239 | As an open-source, open-development community, Blockchain Commons does not have the resources to provide direct support of our projects. Please consider the discussions area as a locale where you might get answers to questions. Alternatively, please use this repository's [issues](./issues) feature. Unfortunately, we can not make any promises on response time.
240 |
241 | If your company requires support to use our projects, please feel free to contact us directly about options. We may be able to offer you a contract for support from one of our contributors, or we might be able to point you to another entity who can offer the contractual support that you need.
242 |
243 | ### Credits
244 |
245 | The following people directly contributed to this repository. You can add your name here by getting involved. The first step is learning how to contribute from our [CONTRIBUTING.md](./CONTRIBUTING.md) documentation.
246 |
247 | | Name | Role | Github | Email | GPG Fingerprint |
248 | | ----------------- | ------------------- | ------------------------------------------------- | ------------------------------------- | -------------------------------------------------- |
249 | | Christopher Allen | Principal Architect | [@ChristopherA](https://github.com/ChristopherA) | \ | FDFE 14A5 4ECB 30FC 5D22 74EF F8D3 6C91 3574 05ED |
250 | | Wolf McNally | Lead Researcher | [@WolfMcNally](https://github.com/wolfmcnally) | \ | 9436 52EE 3844 1760 C3DC 3536 4B6C 2FCF 8947 80AE |
251 |
252 | ## Responsible Disclosure
253 |
254 | We want to keep all of our software safe for everyone. If you have discovered a security vulnerability, we appreciate your help in disclosing it to us in a responsible manner. We are unfortunately not able to offer bug bounties at this time.
255 |
256 | We do ask that you offer us good faith and use best efforts not to leak information or harm any user, their data, or our developer community. Please give us a reasonable amount of time to fix the issue before you publish it. Do not defraud our users or us in the process of discovery. We promise not to bring legal action against researchers who point out a problem provided they do their best to follow the these guidelines.
257 |
258 | ### Reporting a Vulnerability
259 |
260 | Please report suspected security vulnerabilities in private via email to ChristopherA@BlockchainCommons.com (do not use this email for support). Please do NOT create publicly viewable issues for suspected security vulnerabilities.
261 |
262 | The following keys may be used to communicate sensitive information to developers:
263 |
264 | | Name | Fingerprint |
265 | | ----------------- | -------------------------------------------------- |
266 | | Christopher Allen | FDFE 14A5 4ECB 30FC 5D22 74EF F8D3 6C91 3574 05ED |
267 |
268 | You can import a key by running the following command with that individual’s fingerprint: `gpg --recv-keys ""` Ensure that you put quotes around fingerprints that contain spaces.
269 |
--------------------------------------------------------------------------------
/dcbor.md:
--------------------------------------------------------------------------------
1 | # dCBOR
2 |
3 | dCBOR is deterministic CBOR, a optional variant of CBOR described in [RFC 8949](https://www.rfc-editor.org/rfc/rfc8949.html#name-deterministically-encoded-c).
4 |
5 | A deterministic version of CBOR is critical when an application requires the same data to always be encoded in the same way. This is true for [Gordian Envelope](https://www.blockchaincommons.com/introduction/Envelope-Intro/), which uses CBOR to arrange data that is identified by hashes. The hashes only remain the same if the same data is always encoded in the exact same way, hence the need for determinism.
6 |
7 | Though RFC 8949 includes some requirements for dCBOR, it leaves other options up to encoder developers. This results in dCBOR usage that is not necessarily consistent across multiple encoders. As a result, Blockchain Commons has produced an [Internet-Draft](https://datatracker.ietf.org/doc/draft-mcnally-deterministic-cbor/) to fully codify dCBOR practices.
8 |
9 | We have also released libraries for dCBOR in Rust and Swift as well as a command line application for testing encoding and decoding that all follow the specifications laid out in this Draft.
10 |
11 | ## dCBOR Videos
12 |
13 |
14 |
15 |
16 |
17 | Why CBOR?
18 |
19 | |
20 |
21 | dCBOR Library from Blockchain Commons>
22 |
23 | |
24 |
25 |
26 |
27 | ## Preliminary dCBOR Specification
28 |
29 | * **dCBOR IETF I-D** — https://datatracker.ietf.org/doc/draft-mcnally-deterministic-cbor/
30 | * **Editor's Draft (Repo)** — https://github.com/BlockchainCommons/WIPs-IETF-draft-deterministic-cbor
31 |
32 | ## dCBOR Developer Libraries & Applications
33 |
34 | * **bc-dcbor-rust Library** - https://github.com/BlockchainCommons/bc-dcbor-rust
35 | * **BCSwiftDCBOR Library** - https://github.com/BlockchainCommons/BCSwiftDCBOR
36 | * **dcbor-cli Parser/Validator** - https://github.com/BlockchainCommons/dcbor-cli
37 |
38 | ## dCBOR Discussions
39 |
40 | * [6/30/23: cbor - Requested session has been scheduled for IETF 117](https://mailarchive.ietf.org/arch/browse/cbor/?gbt=1&index=X4K-UjBZP6wxxZdWgBYEfCp2vH4)
41 | * [5/31/23: draft-mcnally-deterministic-cbor: rationale for not going with pre-encoded data](https://mailarchive.ietf.org/arch/msg/cbor/X4K-UjBZP6wxxZdWgBYEfCp2vH4/)
42 | * [5/8/23: Updated Drafts for dCBOR I-D and Gordian Envelope Structured Data Format I-D & IANA Tag Registration](https://mailarchive.ietf.org/arch/msg/cbor/DOUxXB-IMTPtvDeGh13ob-IjJsE/)
43 | * [5/8/23: Proposal for Deterministic CBOR (dCBOR) discussion at May 17th meeting](https://mailarchive.ietf.org/arch/msg/cbor/G1oXN5DlSpAt7TI5re-fb1lL69I/)
44 | * [3/12/23: dCBOR moving from numerically-typeless systems](https://mailarchive.ietf.org/arch/msg/cbor/aiGvqw1-sQWJ4pXY3zzQuWwNVzE/)
45 | * [3/10/23: Decoding numbers and compliance verification in dCBOR](https://mailarchive.ietf.org/arch/msg/cbor/LUQ0lMaAA1ADGuRtb1VLahnlQUg/)
46 | * [3/10/23: New IETF Internet-Draft draft-mcnally-deterministic-cbor-00](https://mailarchive.ietf.org/arch/msg/cbor/fnz_F5lQNiDiTJFAaJGB3YJdPik/)
47 | * [3/5/23: Deterministic CBOR as a possible DISPATCH item](https://mailarchive.ietf.org/arch/msg/cbor/qMAOUa8-wIZn5Ts2_53VunGu7Co/)
48 | * [2/16/23: Fwd: New deterministic CBOR Libraries (Rust & Swift) from Blockchain Commons](https://mailarchive.ietf.org/arch/msg/cbor/l7nzQHFjfpK9nfBOHiQ1L-Rr558/)
49 |
--------------------------------------------------------------------------------
/images/README.md:
--------------------------------------------------------------------------------
1 | pictures related to crypto-commons docs, libraries, and apps.
2 |
--------------------------------------------------------------------------------
/images/khaki-300.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/khaki-300.jpg
--------------------------------------------------------------------------------
/images/logos/README.md:
--------------------------------------------------------------------------------
1 | logo images for the crypto commons
2 |
--------------------------------------------------------------------------------
/images/logos/crypto-commons-logo.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons-logo.ai
--------------------------------------------------------------------------------
/images/logos/crypto-commons-logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons-logo.jpg
--------------------------------------------------------------------------------
/images/logos/crypto-commons-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons-logo.png
--------------------------------------------------------------------------------
/images/logos/crypto-commons-logo.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons-logo.psd
--------------------------------------------------------------------------------
/images/logos/crypto-commons-screen.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons-screen.jpg
--------------------------------------------------------------------------------
/images/logos/crypto-commons-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons-screen.png
--------------------------------------------------------------------------------
/images/logos/crypto-commons-screen.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons-screen.psd
--------------------------------------------------------------------------------
/images/logos/crypto-commons-simple.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons-simple.ai
--------------------------------------------------------------------------------
/images/logos/crypto-commons-simple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons-simple.png
--------------------------------------------------------------------------------
/images/logos/crypto-commons-super-simple copy.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons-super-simple copy.ai
--------------------------------------------------------------------------------
/images/logos/crypto-commons-super-simple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons-super-simple.png
--------------------------------------------------------------------------------
/images/logos/crypto-commons.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons.ai
--------------------------------------------------------------------------------
/images/logos/crypto-commons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/logos/crypto-commons.png
--------------------------------------------------------------------------------
/images/sskr-group-1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-group-1.jpeg
--------------------------------------------------------------------------------
/images/sskr-group-2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-group-2.jpeg
--------------------------------------------------------------------------------
/images/sskr-import.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-import.jpeg
--------------------------------------------------------------------------------
/images/sskr-seed-256.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-seed-256.jpg
--------------------------------------------------------------------------------
/images/sskr-seed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-seed.png
--------------------------------------------------------------------------------
/images/sskr-shares-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-shares-1.png
--------------------------------------------------------------------------------
/images/sskr-shares-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-shares-2.png
--------------------------------------------------------------------------------
/images/sskr-shares-256-1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-shares-256-1.jpg
--------------------------------------------------------------------------------
/images/sskr-shares-256-2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-shares-256-2.jpg
--------------------------------------------------------------------------------
/images/sskr-shares-256-3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-shares-256-3.jpg
--------------------------------------------------------------------------------
/images/sskr-shares-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-shares-3.png
--------------------------------------------------------------------------------
/images/sskr-single-1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-single-1.jpeg
--------------------------------------------------------------------------------
/images/sskr-single-2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/sskr-single-2.jpeg
--------------------------------------------------------------------------------
/images/vectors/README.md:
--------------------------------------------------------------------------------
1 | Test vectors.
2 |
--------------------------------------------------------------------------------
/images/vectors/ffa11a8-Yinmn-Blue-Puff-Seed-UR.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/ffa11a8-Yinmn-Blue-Puff-Seed-UR.jpeg
--------------------------------------------------------------------------------
/images/vectors/ffa11a8-Yinmn-Blue-Puff-Seed-UR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/ffa11a8-Yinmn-Blue-Puff-Seed-UR.png
--------------------------------------------------------------------------------
/images/vectors/vector-master-private-comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-master-private-comment.png
--------------------------------------------------------------------------------
/images/vectors/vector-master-private.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-master-private.png
--------------------------------------------------------------------------------
/images/vectors/vector-master-public-comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-master-public-comment.png
--------------------------------------------------------------------------------
/images/vectors/vector-master-public.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-master-public.png
--------------------------------------------------------------------------------
/images/vectors/vector-request-khaki.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-request-khaki.png
--------------------------------------------------------------------------------
/images/vectors/vector-request-yinmn-note.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-request-yinmn-note.png
--------------------------------------------------------------------------------
/images/vectors/vector-request-yinmn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-request-yinmn.png
--------------------------------------------------------------------------------
/images/vectors/vector-seed-khaki-date.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-seed-khaki-date.png
--------------------------------------------------------------------------------
/images/vectors/vector-seed-khaki-lnote.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-seed-khaki-lnote.png
--------------------------------------------------------------------------------
/images/vectors/vector-seed-khaki-name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-seed-khaki-name.png
--------------------------------------------------------------------------------
/images/vectors/vector-seed-khaki-note.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-seed-khaki-note.png
--------------------------------------------------------------------------------
/images/vectors/vector-seed-khaki.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-seed-khaki.png
--------------------------------------------------------------------------------
/images/vectors/vector-seed-yinmn-date.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-seed-yinmn-date.png
--------------------------------------------------------------------------------
/images/vectors/vector-seed-yinmn-lnote.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-seed-yinmn-lnote.png
--------------------------------------------------------------------------------
/images/vectors/vector-seed-yinmn-name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-seed-yinmn-name.png
--------------------------------------------------------------------------------
/images/vectors/vector-seed-yinmn-note.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-seed-yinmn-note.png
--------------------------------------------------------------------------------
/images/vectors/vector-seed-yinmn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-seed-yinmn.png
--------------------------------------------------------------------------------
/images/vectors/vector-segwit-cosigner-private-comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-segwit-cosigner-private-comment.png
--------------------------------------------------------------------------------
/images/vectors/vector-segwit-cosigner-private.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-segwit-cosigner-private.png
--------------------------------------------------------------------------------
/images/vectors/vector-segwit-cosigner-public-comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-segwit-cosigner-public-comment.png
--------------------------------------------------------------------------------
/images/vectors/vector-segwit-cosigner-public.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-segwit-cosigner-public.png
--------------------------------------------------------------------------------
/images/vectors/vector-segwit-single-private-comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-segwit-single-private-comment.png
--------------------------------------------------------------------------------
/images/vectors/vector-segwit-single-private.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-segwit-single-private.png
--------------------------------------------------------------------------------
/images/vectors/vector-segwit-single-public-comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-segwit-single-public-comment.png
--------------------------------------------------------------------------------
/images/vectors/vector-segwit-single-public.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/vectors/vector-segwit-single-public.png
--------------------------------------------------------------------------------
/images/video-tech-overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/video-tech-overview.png
--------------------------------------------------------------------------------
/images/yinmn-blue-300.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlockchainCommons/crypto-commons/a2f4151ace8eb71748925e45e39e3bfc418f20d6/images/yinmn-blue-300.jpg
--------------------------------------------------------------------------------