Overview
The system consists of three independent signer services. Each service acts as an HTTPS peer server and a Telegram bot. Any addressed bot can coordinate a protocol round.
During /create, key material is produced through distributed deterministic derivation and distributed share generation. During signing, the nodes produce a threshold Schnorr signature without reconstructing the full private key.
Personal mode
One Telegram user receives one deterministic Taproot address and can sign or send with approval.
/create@bot/sign@bot/signhash@bot/send@bot
Group mode
One initiator and two additional Telegram IDs receive one deterministic group address. Member order does not matter.
/create@bot <user_id2> <user_id3>/multisign@bot/multisignhash@bot/multisend@bot
Project structure
The active V1 implementation uses the following components:
three-headed-bot.js- entry point, peer server, and protocol orchestration.crypto_backend.js- cryptography, storage, peer transport, and Bitcoin transaction construction.tg_backend.js- Telegram polling, command parsing, and approval handling.node-1.config.json,node-2.config.json,node-3.config.json- signer configurations.v1/data- local persistent share and wallet data for each node.
Configuration
Each signer uses one JSON configuration. Critical fields include:
protocol_fixnode.index_fixcrypto.masterSeed_fixtelegram.botTokentelegram.allowedGroupIdhttp.listenHost,http.port, and TLS certificate fieldspeersbitcoin.providers
Secret
crypto.masterSeed_fixhttp.tls.keyPem- contents of
v1/data
Not secret
- Telegram bot usernames
- Bitcoin addresses
- group keys
- peer IP addresses and ports
Start
Install dependencies:
npm install
Run all three nodes in separate terminals:
node v1/three-headed-bot.js v1/node-1.config.json
node v1/three-headed-bot.js v1/node-2.config.json
node v1/three-headed-bot.js v1/node-3.config.json
Or use the npm script:
npm run v1:start -- v1/node-1.config.json
Telegram commands
Every command must be addressed to a specific bot and sent inside the configured Telegram group.
/create@bot
/create@bot <user_id2> <user_id3>
/address@bot
/balance@bot [<address>]
/utxo@bot
/status@bot
/sign@bot <message>
/signhash@bot <32-byte-hex-hash>
/send@bot <to_address> <amount_sats> <fee_rate>
/multisign@bot <user_id2> <user_id3> <message>
/multisignhash@bot <user_id2> <user_id3> <32-byte-hex-hash>
/multisend@bot <user_id2> <user_id3> <to_address> <amount_sats> <fee_rate>
/approve@bot
/reject@bot
An amount_sats value of zero enables send-all mode, with the calculated fee subtracted from the available total.
Approval flow
Signing and sending commands require approval before the second signer releases its partial signature.
Personal
- The user sends a command to one bot.
- That bot becomes coordinator and selects a second signer.
- The second signer posts an approval request.
- The same user sends
/approveor/reject.
Group
- The initiator sends a multi-user command.
- The second signer posts an approval request.
- Either listed additional member may approve.
- The request aborts if no approval arrives before timeout.
Bitcoin logic
Provider model
The provider layer uses Esplora-compatible HTTP APIs. Balance and UTXO queries compare configured providers, while transaction broadcast succeeds when at least one selected provider accepts the final raw transaction.
Send pipeline
- Validate destination, amount, and fee rate.
- Fetch UTXOs from configured providers and check consistency.
- Build the Taproot spend candidate and select inputs.
- Compute one BIP341 sighash for every selected input.
- Threshold-sign each input without reconstructing the private key.
- Finalize the witness and broadcast the raw transaction.
Testing
Personal flow
/create@bank_node_1_bot
/address@bank_node_1_bot
/balance@bank_node_1_bot
/sign@bank_node_1_bot hello world
/signhash@bank_node_1_bot 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
Group flow
/create@bank_node_1_bot 111111111 222222222
/address@bank_node_1_bot
/balance@bank_node_1_bot
/multisign@bank_node_1_bot 111111111 222222222 hello
/multisignhash@bank_node_1_bot 111111111 222222222 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
Send examples
/send@bank_node_1_bot bc1p... 15000 3
/send@bank_node_1_bot bc1p... 0 3
/multisend@bank_node_1_bot 111111111 222222222 bc1p... 15000 3
Troubleshooting
sign already in progress
Finish the active approval flow, wait for timeout, or inspect the coordinator logs.
no address ... run create first
Run personal /create or group /create <id2> <id3>.
bitcoin providers inconsistent
Configured providers returned different UTXO views. Retry later or replace the inconsistent provider.
all bitcoin providers unavailable
Check network access and provider URLs in all node configurations.
Security review
AI-assisted security review
The Bitcoin threshold Schnorr implementation and its operational controls were reviewed with Claude Mythos and GPT-5.6 as AI-assisted analysis tools. This review does not replace an independent professional security audit.