multisig-hsm/reference/diag_hsm.py
mineracks 7a17ffd12e Initial public release — multisig HSM reference + recipe book
Open-source 2-of-3 policy-enforced threshold HSM: auto-signs cold→hot treasury
refills under on-device Coldcard policy, no human in the loop. Includes the full
operator manual + quick-start, the reference coordinator/signing code, and a
signer-host bootstrap. No keys, seeds, or secrets — placeholders only.

Live signet demo: https://multisighsm.mineracks.com

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:56:51 +10:00

19 lines
850 B
Python

import os, io, time, json
from ckcc.client import ColdcardDevice
from ckcc.protocol import CCProtocolPacker
from ckcc.cli import real_file_upload
d=ColdcardDevice(sn='/tmp/cksim-3.sock')
def E(c):
r=d.send_recv(b'EXEC'+c.encode(),encrypt=False); return r.decode() if isinstance(r,(bytes,bytearray)) else r
def K(k): d.send_recv(CCProtocolPacker.sim_keypress(k.encode('ascii')))
def st():
r=d.send_recv(CCProtocolPacker.hsm_status()); r=r.decode() if isinstance(r,(bytes,bytearray)) else r; return json.loads(r)
S=lambda: E("RV.write(repr(sim_display.story))")
pf=os.path.expanduser('~/cksim/policy.json')
flen,sha=real_file_upload(open(pf,'rb'),d)
d.send_recv(CCProtocolPacker.hsm_start(flen,sha)); time.sleep(1.5)
print('SCREEN1:', S()[:600])
K('y'); time.sleep(1.5)
print('SCREEN2:', S()[:600])
print('ACTIVE_after_y:', st().get('active'))