{"id":14980066,"url":"https://github.com/coldcard/ckcc-protocol","last_synced_at":"2025-03-02T13:13:07.548Z","repository":{"id":32614936,"uuid":"138057621","full_name":"Coldcard/ckcc-protocol","owner":"Coldcard","description":"Python library and command line tool for communicating with your Coldcard over USB","archived":false,"fork":false,"pushed_at":"2024-07-09T13:22:44.000Z","size":1439,"stargazers_count":58,"open_issues_count":4,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-02T13:12:56.957Z","etag":null,"topics":["bitcoin","bitcoin-wallet"],"latest_commit_sha":null,"homepage":"https://coldcardwallet.com","language":"Python","has_issues":false,"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/Coldcard.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"COPYING-CC","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-20T16:18:30.000Z","updated_at":"2024-12-01T18:19:58.000Z","dependencies_parsed_at":"2024-09-24T04:01:57.071Z","dependency_job_id":"4d1a13f2-9fec-4dbf-adaf-e891c0fdf505","html_url":"https://github.com/Coldcard/ckcc-protocol","commit_stats":{"total_commits":170,"total_committers":9,"mean_commits":18.88888888888889,"dds":"0.30000000000000004","last_synced_commit":"0e686dbda686f76c4d3e8069558b2a31f9d1c2b1"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coldcard%2Fckcc-protocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coldcard%2Fckcc-protocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coldcard%2Fckcc-protocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coldcard%2Fckcc-protocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Coldcard","download_url":"https://codeload.github.com/Coldcard/ckcc-protocol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241509655,"owners_count":19974071,"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","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":["bitcoin","bitcoin-wallet"],"created_at":"2024-09-24T14:01:14.604Z","updated_at":"2025-03-02T13:13:07.525Z","avatar_url":"https://github.com/Coldcard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coldcard CLI and Python Interface Library\n\nColdcard is a Cheap, Ultra-secure \u0026 Opensource Hardware Wallet for #Bitcoin.\n\nGet yours at [ColdcardWallet.com](http://coldcard.com)\n\nThis is the python code and command-line utilities you need to communicate with it over USB.\n\n## Setup For Everyday Use\n\n- `pip install 'ckcc-protocol[cli]'`\n\nThis installs a single helpful command line program: `ckcc`\n\nIf you just want the python library, use:\n\n- `pip install ckcc-protocol`\n\n\n## Setup If You Might Change the Code\n\n- do a git checkout\n- probably make a fresh virtual env\n- run:\n\n```\npip install -r requirements.txt\npip install --editable '.[cli]'\n```\n\n## Requirements\n\n- python 3.6 or higher\n- `hidapi` for USB HID access in a portable way.\n- see `requirements.txt` file for more details.\n\n\n# CLI Examples\n\n## Command Arguments\n\n```\n% ckcc\nUsage: ckcc [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  -s, --serial HEX  Operate on specific unit (default: first found)\n  -x, --simulator   Connect to the simulator via Unix socket\n  -P, --plaintext   Disable USB link-layer encryption\n  --help            Show this message and exit.\n\nCommands:\n  addr        Show the human version of an address\n  auth        Indicate specific user is present (for HSM).\n  backup      Creates 7z encrypted backup file after prompting user to...\n  bag         Factory: set or read bag number -- single use only!\n  chain       Get which blockchain (Bitcoin/Testnet) is configured.\n  convert2cc  Convert existing Electrum wallet file into COLDCARD wallet...\n  debug       Start interactive (local) debug session\n  eval        Simulator only: eval a python statement\n  exec        Simulator only: exec a python script\n  get-locker  Get the value held in the Storage Locker (not Bitcoin...\n  hsm         Get current status of HSM feature.\n  hsm-start   Enable Hardware Security Module (HSM) mode.\n  list        List all attached Coldcard devices\n  local-conf  Generate the 6-digit code needed for a specific PSBT file...\n  logout      Securely logout of device (will require replug to start over)\n  miniscript  Miniscript related commands\n  msg         Sign a short text message\n  multisig    Create a skeleton file which defines a multisig wallet.\n  p2sh        Show a multisig payment address on-screen.\n  pass        Provide a BIP39 passphrase\n  pubkey      Get the public key for a derivation path\n  reboot      Reboot coldcard, force relogin and start over\n  sign        Approve a spending transaction by signing it on Coldcard\n  test        Test USB connection (debug/dev)\n  upgrade     Send firmware file (.dfu) and trigger upgrade process\n  upload      Send file to Coldcard (PSBT transaction or firmware)\n  user        Create a new user on the Coldcard for HSM policy (also...\n  version     Get the version of the firmware installed\n  xfp         Get the fingerprint for this wallet (master level)\n  xpub        Get the XPUB for this wallet (master level, or any derivation)\n```\n\n\n## Message Signing\n\n```\n% ckcc msg --help\nUsage: ckcc msg [OPTIONS] MESSAGE\n\n  Sign a short text message\n\nOptions:\n  -p, --path DERIVATION  Derivation for key to use [default: m/44'/0'/0'/0/0]\n  -v, --verbose          Include fancy ascii armour\n  -j, --just-sig         Just the signature itself, nothing more\n  -s, --segwit           Address in segwit native (p2wpkh, bech32)\n  -w, --wrap             Address in segwit wrapped in P2SH (p2wpkh)\n  --help                 Show this message and exit.\n\n% ckcc msg \"Hello Coldcard\" -p m/34/23/33\nWaiting for OK on the Coldcard...\nHello Coldcard                    \n1KSXaNHh3G4sfTMsp9q8CmACeqsJn46drd\nH4mTuwMUdnu3MyMA+6aJ3hiAF4L0WBDZFseTEno511hNN8/THIeM4GW4SnrcJJhS3WxMZEWFdEIZDSP+H5aIcao=\n```\n\n\n## Transaction Signing\n\n```\n% ckcc sign --help\nUsage: ckcc sign [OPTIONS] PSBT_IN [PSBT_OUT]\n\n  Approve a spending transaction by signing it on Coldcard\n\nOptions:\n  -f, --finalize    Show final signed transaction, ready for transmission\n  -z, --visualize   Show text of Coldcard's interpretation of the transaction\n                    (does not create transaction, no interaction needed)\n  -p, --pushtx URL  Broadcast transaction via provided PushTx URL. Shortcut\n                    options: coldcard, mempool\n  -s, --signed      Include a signature over visualization text\n  -x, --hex         Write out (signed) PSBT in hexidecimal\n  -6, --base64      Write out (signed) PSBT encoded in base64\n  --help            Show this message and exit.\n\n% (... acquire PSBT file for what you want to do ...)\n\n% ckcc sign example.psbt out.psbt\n5071 bytes (start @ 0) to send from 'example.psbt'\nUploading  [####################################]  100%\nWaiting for OK on the Coldcard...\nOk! Downloading result (5119 bytes)\n\n%  hexdump -C out.psbt | head -3\n00000000  70 73 62 74 ff 01 00 fd  22 04 02 00 00 00 04 3f  |psbt....\"......?|\n00000010  ee 16 30 9d 14 82 36 dd  c8 3e 9e 4f 94 47 83 00  |..0...6..\u003e.O.G..|\n00000020  c2 23 e1 06 22 1b 02 0e  bd c8 1c 71 79 7d 3c 02  |.#..\"......qy}\u003c.|\n00000030  00 00 00 00 fe ff ff ff  4c 85 a0 2c 80 cb 2c 01  |........L..,..,.|\n\n```\n\n## Miniscript\n\n```\nUsage: ckcc miniscript [OPTIONS] COMMAND [ARGS]...\n\n  Miniscript related commands\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  addr    Get miniscript internal/external chain address by index with on...\n  del     Delete registered miniscript wallet by name with on device...\n  enroll  Enroll miniscript wallet\n  get     Get registered miniscript wallet by name.\n  ls      List registered miniscript wallet names.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoldcard%2Fckcc-protocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoldcard%2Fckcc-protocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoldcard%2Fckcc-protocol/lists"}