{"id":18519087,"url":"https://github.com/blockchaincommons/bc-dcbor-cli","last_synced_at":"2025-09-07T21:45:08.682Z","repository":{"id":97337787,"uuid":"601084261","full_name":"BlockchainCommons/bc-dcbor-cli","owner":"BlockchainCommons","description":"A command line Deterministic CBOR (\"dCBOR\") validation and diagnostic tool.","archived":false,"fork":false,"pushed_at":"2025-07-03T18:13:48.000Z","size":113,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-03T19:25:41.566Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlockchainCommons.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY-REVIEW.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["BlockchainCommons","ChristopherA"],"custom":"https://btcpay.blockchaincommons.com"}},"created_at":"2023-02-13T10:35:20.000Z","updated_at":"2025-07-03T18:11:37.000Z","dependencies_parsed_at":"2024-06-08T04:44:19.249Z","dependency_job_id":"85852e1c-1aaa-4e98-a9f0-a9a93c306ca3","html_url":"https://github.com/BlockchainCommons/bc-dcbor-cli","commit_stats":null,"previous_names":["blockchaincommons/bc-dcbor-cli"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/BlockchainCommons/bc-dcbor-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockchainCommons%2Fbc-dcbor-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockchainCommons%2Fbc-dcbor-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockchainCommons%2Fbc-dcbor-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockchainCommons%2Fbc-dcbor-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlockchainCommons","download_url":"https://codeload.github.com/BlockchainCommons/bc-dcbor-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockchainCommons%2Fbc-dcbor-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274101781,"owners_count":25222446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T17:15:17.590Z","updated_at":"2025-09-07T21:45:08.671Z","avatar_url":"https://github.com/BlockchainCommons.png","language":"Rust","readme":"# Blockchain Commons command line parser/validator for deterministic CBOR (\"dCBOR\")\n\n\u003c!--Guidelines: https://github.com/BlockchainCommons/secure-template/wiki --\u003e\n\n### _by Wolf McNally_\n\n---\n\n`dcbor` is a command line Deterministic CBOR (\"dCBOR\") validation and diagnostic tool based on [the crate of the same name](https://crates.io/crates/dcbor).\n\n* Validates dCBOR inputs.\n* Receives inputs in hex or binary format.\n* Formats output several different ways:\n  * CBOR diagnostic notation (compact or annotated).\n  * Hexadecimal (compact or annotated).\n  * Binary\n\n## Related Projects\n\n* [dCBOR Overview](https://github.com/BlockchainCommons/crypto-commons/blob/master/dcbor.md)\n* [dCBOR Library for Rust](https://github.com/BlockchainCommons/bc-dcbor-rust)\n* [dCBOR Library for Swift](https://github.com/BlockchainCommons/BCSwiftDCBOR)\n\n## Installation\n\nTo install from crates.io, run:\n\n```bash\ncargo install dcbor-cli\n```\n\nTo install from source, clone this repo, change to its root directory and run:\n\n```bash\ncargo install --path .\n```\n\n## Command Line Syntax\n\nThis is the command line syntax as output by typing `dcbor --help`:\n\n```\nCommand line parser/validator for deterministic CBOR (\"dCBOR\").\n\nUsage: dcbor [OPTIONS] [INPUT] [COMMAND]\n\nCommands:\n  array  Compose a dCBOR array from the provided elements\n  map    Compose a dCBOR map from the provided keys and values\n  help   Print this message or the help of the given subcommand(s)\n\nArguments:\n  [INPUT]\n          Input dCBOR in the format specified by `--in`. If not provided here or input format is binary, input is read from STDIN\n\nOptions:\n  -i, --in \u003cIN\u003e\n          The input format\n\n          [default: diag]\n\n          Possible values:\n          - diag: CBOR diagnostic notation\n          - hex:  Hexadecimal\n          - bin:  Raw binary\n\n  -o, --out \u003cOUT\u003e\n          The output format\n\n          [default: hex]\n\n          Possible values:\n          - diag: CBOR diagnostic notation\n          - hex:  Hexadecimal\n          - bin:  Raw binary\n          - none: No output: merely succeeds on validation of input\n\n  -a, --annotate\n          Output diagnostic notation or hexadecimal with annotations. Ignored for other output formats\n\n  -h, --help\n          Print help (see a summary with '-h')\n\n  -V, --version\n          Print version\n```\n\n## Examples\n\n### Convert CBOR diagnostic notation to hexadecimal\n\n\u003e **NOTE:** The default input format is `diag` and the default output format is `hex`. This is not the same as previous versions of `dcbor`. This change was made to facilitate the use of `dcbor` as a compositional tool for dCBOR in scripts.\n\nThis example shows how to convert a simple CBOR diagnostic notation input (a number) to its serialized hexadecimal form:\n\n```\n$ dcbor '42'\n182a\n```\n\nFloating point numbers work the same way:\n\n```\n$ dcbor '3.14'\nfb40091eb851eb851f\n```\n\nIn diagnostic notation, text strings must be enclosed in double quotes, so you must do so on the command line, which requires escaping the double quotes:\n\n```\n$ dcbor '\"Hello\"'\n6548656c6c6f\n```\n\nTo avoid escaping no matter the complexity of the input, you can use a \"here document\" (a.k.a. \"heredoc\"). This example is the same as the previous one, but it uses a heredoc to avoid escaping the double quotes:\n\n```\n$ dcbor \u003c\u003cEOF\n\"Hello\"\nEOF\n6548656c6c6f\n```\n\n### Validate dCBOR and print it out as annotated CBOR diagnostic notation\n\n```\n$ dcbor --in hex --out diag 6548656c6c6f\n\"Hello\"\n```\n\nAnnotated diagnostic notation includes comments that describe the type of each element. The `--annotate` option adds these comments:\n\n```\n$ CBOR_HEX=d99d6ca4015059f2293a5bce7d4de59e71b4207ac5d202c11a6035970003754461726b20507572706c652041717561204c6f766504787b4c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f726520657420646f6c6f7265206d61676e6120616c697175612e\n\n$ FLAT_DIAG=`dcbor --in hex --out diag $CBOR_HEX`\n$ echo $FLAT_DIAG\n40300({1: h'59f2293a5bce7d4de59e71b4207ac5d2', 2: 1(1614124800), 3: \"Dark Purple Aqua Love\", 4: \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"})\n\n$ ANNOTATE_DIAG=`dcbor --in hex --out diag --annotate $CBOR_HEX`\n$ echo $ANNOTATE_DIAG\n40300(   / seed /\n    {\n        1:\n        h'59f2293a5bce7d4de59e71b4207ac5d2',\n        2:\n        1(1614124800),   / date /\n        3:\n        \"Dark Purple Aqua Love\",\n        4:\n        \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n    }\n)\n```\n\nEither way, the output should round-trip back to the original hexadecimal form. The following example shows how to do this:\n```\n$ CBOR_HEX_2=`dcbor $FLAT_DIAG`\n$ [ \"$CBOR_HEX\" = \"$CBOR_HEX_2\" ] \u0026\u0026 echo \"successful\" || echo \"unsuccessful\"\nsuccessful\n\n$ CBOR_HEX_3=`dcbor $ANNOTATE_DIAG`\n$ [ \"$CBOR_HEX\" = \"$CBOR_HEX_3\" ] \u0026\u0026 echo \"successful\" || echo \"unsuccessful\"\n```\n\n### Validate dCBOR and print it out as annotated hexadecimal\n\n```\n$ dcbor --in hex --out hex --annotate $CBOR_HEX\nd9 9d6c                                 # tag(40300) seed\n    a4                                  # map(4)\n        01                              # unsigned(1)\n        50                              # bytes(16)\n            59f2293a5bce7d4de59e71b4207ac5d2\n        02                              # unsigned(2)\n        c1                              # tag(1) date\n            1a60359700                  # unsigned(1614124800)\n        03                              # unsigned(3)\n        75                              # text(21)\n            4461726b20507572706c652041717561204c6f7665 # \"Dark Purple Aqua Love\"\n        04                              # unsigned(4)\n        78 7b                           # text(123)\n            4c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f726520657420646f6c6f7265206d61676e6120616c697175612e # \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n```\n\n### Convert dCBOR from Hexadecimal to Binary and Back\n\n```\n# Write the binary to a file using stdout.\n$ dcbor --in hex --out bin $CBOR_HEX \u003etest.bin\n\n# Read it back in from the same file.\n$ dcbor --in bin \u003ctest.bin\nd99d6ca4015059f2293a5bce7d4de59e71b4207ac5d202c11a6035970003754461726b20507572706c652041717561204c6f766504787b4c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f726520657420646f6c6f7265206d61676e6120616c697175612e\n```\n\n## Status - Alpha\n\n`dcbor`  is currently under active development and in the alpha testing phase. It should not be used for production tasks until it has had further testing and auditing. See [Blockchain Commons' Development Phases](https://github.com/BlockchainCommons/Community/blob/master/release-path.md).\n\n## Version History\n\n**0.10.0** - July 6, 2025\n- Align to dependencies.\n\n**0.9.0** - July 5, 2025\n- Update dcbor-pattern dependency to 0.2.0\n- Fix test patterns for array and map matching\n\n**0.8.0** - July 3, 2025\n- Add pattern matching functionality with dcbor-pattern integration\n- Add new match command for pattern-based CBOR data querying\n- Restructure CLI with dedicated subcommands (array, default, map, match)\n- Update dependencies (bc-components, dcbor, dcbor-parse)\n- Add comprehensive test suite for new functionality\n\n## Financial Support\n\n`dcbor` is a project of [Blockchain Commons](https://www.blockchaincommons.com/). We are proudly a \"not-for-profit\" social benefit corporation committed to open source \u0026 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.\n\nTo financially support further development of `dcbor` 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/).\n\n## Contributing\n\nWe 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).\n\n### Discussions\n\nThe best place to talk about Blockchain Commons and its projects is in our GitHub Discussions areas.\n\n[**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).\n\n[**Gordian User Community**](https://github.com/BlockchainCommons/Gordian/discussions). For users of the Gordian reference apps, including [Gordian Coordinator](https://github.com/BlockchainCommons/iOS-GordianCoordinator), [Gordian Seed Tool](https://github.com/BlockchainCommons/GordianSeedTool-iOS), [Gordian Server](https://github.com/BlockchainCommons/GordianServer-macOS), [Gordian Wallet](https://github.com/BlockchainCommons/GordianWallet-iOS), and [SpotBit](https://github.com/BlockchainCommons/spotbit) as well as our whole series of [CLI apps](https://github.com/BlockchainCommons/Gordian/blob/master/Docs/Overview-Apps.md#cli-apps). This is a place to talk about bug reports and feature requests as well as to explore how our reference apps embody the [Gordian Principles](https://github.com/BlockchainCommons/Gordian#gordian-principles).\n\n[**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\n[Gordian User Community](https://github.com/BlockchainCommons/Gordian/discussions).\n\n### Other Questions \u0026 Problems\n\nAs 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.\n\nIf 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.\n\n### Credits\n\nThe 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.\n\n| Name              | Role                     | Github                                           | Email                                 | GPG Fingerprint                                    |\n| ----------------- | ------------------------ | ------------------------------------------------ | ------------------------------------- | -------------------------------------------------- |\n| Christopher Allen | Principal Architect      | [@ChristopherA](https://github.com/ChristopherA) | \\\u003cChristopherA@LifeWithAlacrity.com\\\u003e | FDFE 14A5 4ECB 30FC 5D22  74EF F8D3 6C91 3574 05ED |\n| Wolf McNally      | Lead Researcher/Engineer | [@WolfMcNally](https://github.com/wolfmcnally)   | \\\u003cWolf@WolfMcNally.com\\\u003e              | 9436 52EE 3844 1760 C3DC  3536 4B6C 2FCF 8947 80AE |\n\n## Responsible Disclosure\n\nWe 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.\n\nWe 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.\n\n### Reporting a Vulnerability\n\nPlease 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.\n\nThe following keys may be used to communicate sensitive information to developers:\n\n| Name              | Fingerprint                                        |\n| ----------------- | -------------------------------------------------- |\n| Christopher Allen | FDFE 14A5 4ECB 30FC 5D22  74EF F8D3 6C91 3574 05ED |\n\nYou can import a key by running the following command with that individual’s fingerprint: `gpg --recv-keys \"\u003cfingerprint\u003e\"` Ensure that you put quotes around fingerprints that contain spaces.\n","funding_links":["https://github.com/sponsors/BlockchainCommons","https://github.com/sponsors/ChristopherA","https://btcpay.blockchaincommons.com"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockchaincommons%2Fbc-dcbor-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblockchaincommons%2Fbc-dcbor-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockchaincommons%2Fbc-dcbor-cli/lists"}