{"id":18031477,"url":"https://github.com/cmdruid/frost","last_synced_at":"2025-09-20T23:33:14.622Z","repository":{"id":259913731,"uuid":"875341819","full_name":"cmdruid/frost","owner":"cmdruid","description":"Flexible, round-optimized threshold signature library for BIP340 taproot.","archived":false,"fork":false,"pushed_at":"2024-11-10T21:45:56.000Z","size":8061,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-27T09:04:36.510Z","etag":null,"topics":["bitcoin","cryptography","frost","threshold"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@cmdcode/frost","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmdruid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-10-19T18:06:38.000Z","updated_at":"2024-11-10T21:45:59.000Z","dependencies_parsed_at":"2024-10-28T17:46:10.564Z","dependency_job_id":"e66a90a9-d54b-4f50-bf48-e4221a21b058","html_url":"https://github.com/cmdruid/frost","commit_stats":null,"previous_names":["cmdruid/frost"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdruid%2Ffrost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdruid%2Ffrost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdruid%2Ffrost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdruid%2Ffrost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmdruid","download_url":"https://codeload.github.com/cmdruid/frost/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230206107,"owners_count":18190017,"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","cryptography","frost","threshold"],"created_at":"2024-10-30T10:09:17.780Z","updated_at":"2025-09-20T23:33:09.565Z","avatar_url":"https://github.com/cmdruid.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FROST\n\nFlexible round-optimized schnorr threshold signatures for Bitcoin.\n\n## How to Use\n\nThe FROST protocol specifies two rounds for producing a threshold signature.\n\n**Initial setup of parameters (using a trusted dealer):**\n\nThis repository uses a trusted dealer method for demonstration purposes. Feel free to use your own [Distributed Key Generation](https://en.wikipedia.org/wiki/Distributed_key_generation) (DKG) protocol for generating and distributing shares.\n\n```ts\nimport { create_key_group } from '@cmdcode/frost/lib'\nimport { random_bytes }     from '@cmdcode/frost/util'\n\n// Generate a random secret key and message.\nconst seckey  = random_bytes(32).hex\nconst message = random_bytes(32).hex\n\n// Configure the paramaters of the group.\nconst secrets   = [ seckey ]\nconst threshold = 2\nconst share_max = 3\n\n// Generate a group of secret shares.\nconst group = create_key_group(secrets, threshold, share_max)\n```\n\n**Round 1 Example (nonce commitments):**\n\nEach member that is participating in the signing round must first create a nonce commitment:\n\n```ts\nimport { create_commit_pkg } from '@cmdcode/frost/lib'\n\n// Select a threshold (t) amount of shares and create nonce commitments.\nconst shares  = group.shares.slice(0, threshold)\nconst commits = shares.map(e =\u003e create_commit_pkg(e))\n```\n\nEach member then distributes their nonce commitment to other members.\n\n**Round 2 Example (signing with secret shares):**\n\nOnce all participating member commitments have been collected, we can now produce a partial signature:\n\n```ts\nimport {\n  get_commit_pkg,\n  get_session_context,\n  sign_msg,\n  verify_partial_sig\n} from '@cmdcode/frost/lib'\n\n// Compute the context data for the signing session.\nconst ctx = get_session_ctx(group.pubkey, commits, message)\n\n// Convert the share indices into iterable numbers.\nconst idx = ctx.indexes.map(i =\u003e Number(i) - 1)\n\n// Collect a partial signature from each share.\nconst psigs = idx.map(i =\u003e {\n  const share  = shares[i]\n  const commit = get_commit_pkg(commits, share)\n  const sig    = sign_msg(ctx, share, commit)\n  if (!verify_partial_sig(ctx, commit, sig.pubkey, sig.psig)) {\n    throw new Error('sig share failed validation')\n  }\n  return sig\n})\n```\n\nWhen the partial signatures have been collected, we can aggregate them into a full signature:\n\n```ts\nimport { combine_partial_sigs, verify_final_sig } from '@cmdcode/frost/lib'\n\n// Aggregate the partial signatures into a single signature.\nconst signature = combine_partial_sigs(ctx, psigs)\n\n// Check that the signature is valid.\nconst is_valid  = verify_final_sig(ctx, message, signature)\n\nconsole.log('is valid:', is_valid)\n```\n\n## Development and Testing\n\nTo run the test suite, use the following commands:\n\n```bash\nyarn test    # For yarn.\nnpm run test # For NPM.\n```\n\nThe test suite comes bundled with Bitcoin Core (located in `test/bin`) for testing purposes. Depending on your computer architecture, you may have to replace these binaries with another version, or change the default configuration in `test/tape.ts`.\n\nThere are code examples located in `test/examples` for performing various protocols via FROST and DKG. You can run a test file via the following command:\n\n`yarn load test/example/\u003cexample_name\u003e.ts`\n\nFeel free to check them out!\n\n## Resources\n\n**ZF FROST Book**  \nA guide to the FROST protocol.  \nhttps://frost.zfnd.org/index.html  \n\n**FROST draft specification**  \nA draft specification of the FROST protocol from the IETF.  \nhttps://www.ietf.org/archive/id/draft-irtf-cfrg-frost-15.html  \n\n**ZCash FROST GitHub**  \nA rust implementation of the IETF FROST draft spec, in rust.  \nhttps://github.com/ZcashFoundation/frost  \n\n**FROST BIP340**  \nA draft implemenation of the FROST protocol for BIP340.  \nhttps://github.com/jesseposner/FROST-BIP340  \n\n**Draft BIP for Secure DKG**  \nA draft proposal for secure DKG in FROST, provided by Blockstream Research.  \nhttps://github.com/BlockstreamResearch/bip-frost-dkg  \n\n**ROAST GitHub**  \nA naive implementation of the ROAST protocol, written in rust.  \nhttps://github.com/robot-dreams/roast  \n\n**FROST Whitepaper**  \nThe white-paper for FROST: Flexible Round-Optimized Schnorr Threshold Signatures  \nhttps://eprint.iacr.org/2020/852.pdf  \n\n**ROAST Whitepaper**  \nA white-paper for ROAST: Robust Asynchronous Schnorr Threshold Signatures.  \nhttps://eprint.iacr.org/2022/550.pdf  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmdruid%2Ffrost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmdruid%2Ffrost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmdruid%2Ffrost/lists"}