{"components":{"schemas":{"Algorithm":{"enum":["ecdsa","sm2"],"type":"string"},"ChangePasswordInput":{"properties":{"new_password":{"type":"string"},"old_password":{"type":"string"}},"required":["old_password","new_password"],"type":"object"},"DeviceInput":{"properties":{"id":{"type":"string"},"password":{"type":"string"}},"required":["id","password"],"type":"object"},"DeviceShare":{"description":"Sensitive local diagnostic response. Never include in state, events or reports.","properties":{"algorithm":{"$ref":"#/components/schemas/Algorithm"},"device_id":{"type":"string"},"epoch":{"format":"int32","minimum":0,"type":"integer"},"member_index":{"format":"int32","minimum":0,"type":"integer"},"public_share":{"type":"string"},"share_hex":{"description":"One device's 32-byte scalar, big-endian hex; not a complete wallet key.","type":"string"},"wallet_id":{"type":"string"},"wallet_public_key":{"type":"string"}},"required":["device_id","wallet_id","algorithm","epoch","member_index","share_hex","public_share","wallet_public_key"],"type":"object"},"DeviceView":{"properties":{"id":{"type":"string"},"identity":{"type":"string"},"link_versions":{"additionalProperties":{"format":"int32","minimum":0,"type":"integer"},"description":"Public LK generations only. Null while locked; no link keys are exported.","propertyNames":{"type":"string"},"type":["object","null"]},"locked":{"type":"boolean"},"wallet_ids":{"items":{"type":"string"},"type":"array"}},"required":["id","locked","identity","wallet_ids"],"type":"object"},"Event":{"properties":{"bytes":{"minimum":0,"type":"integer"},"code":{"type":["string","null"]},"compute_ms":{"format":"double","type":"number"},"from":{"type":"string"},"kind":{"type":"string"},"label":{"type":"string"},"payload":{},"phase":{"type":"string"},"seq":{"format":"int64","minimum":0,"type":"integer"},"to":{"type":"string"}},"required":["seq","phase","from","to","kind","label","payload","bytes","compute_ms"],"type":"object"},"Execution":{"enum":["auto","manual"],"type":"string"},"LifecycleError":{"properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"type":"object"},"ManagedWallet":{"allOf":[{"$ref":"#/components/schemas/WalletInfo"},{"properties":{"archived":{"type":"boolean"}},"required":["archived"],"type":"object"}]},"Metrics":{"properties":{"active_ms":{"format":"double","type":"number"},"bytes":{"minimum":0,"type":"integer"},"compute_ms":{"format":"double","type":"number"},"logical_messages":{"minimum":0,"type":"integer"},"transport_messages":{"minimum":0,"type":"integer"}},"required":["logical_messages","transport_messages","bytes","compute_ms"],"type":"object"},"Mode":{"enum":["relay","peer"],"type":"string"},"OperationKind":{"enum":["dkg","refresh","reshare","recover","presign","sign","backup_export","backup_import"],"type":"string"},"OperationRequest":{"properties":{"algorithm":{"default":"ecdsa","oneOf":[{"$ref":"#/components/schemas/Algorithm"}]},"auth":{"default":null,"description":"Public approval proof in hex, never a device password or bearer secret.","type":["string","null"]},"count":{"default":1,"minimum":0,"type":"integer"},"digest":{"default":null,"type":["string","null"]},"execution":{"default":"auto","oneOf":[{"$ref":"#/components/schemas/Execution"}]},"expected_epoch":{"default":null,"format":"int32","minimum":0,"type":["integer","null"]},"kind":{"default":"dkg","oneOf":[{"$ref":"#/components/schemas/OperationKind"}]},"lost_device":{"default":null,"type":["string","null"]},"members":{"default":["A","B","C"],"items":{"type":"string"},"type":"array"},"mode":{"default":"relay","oneOf":[{"$ref":"#/components/schemas/Mode"}]},"new_members":{"default":[],"items":{"type":"string"},"type":"array"},"new_threshold":{"default":null,"format":"int32","minimum":0,"type":["integer","null"]},"participants":{"default":[],"items":{"type":"string"},"type":"array"},"replacement":{"default":null,"type":["string","null"]},"scenario":{"default":"normal","type":"string"},"threshold":{"default":2,"format":"int32","minimum":0,"type":"integer"},"wallet_id":{"default":"demo-ecdsa","type":"string"}},"type":"object"},"OperationView":{"properties":{"algorithm":{"$ref":"#/components/schemas/Algorithm"},"error":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/LifecycleError"}]},"events":{"items":{"$ref":"#/components/schemas/Event"},"type":"array"},"id":{"type":"string"},"kind":{"$ref":"#/components/schemas/OperationKind"},"metrics":{"$ref":"#/components/schemas/Metrics"},"mode":{"$ref":"#/components/schemas/Mode"},"result":{},"status":{"type":"string"},"wallet_id":{"type":"string"}},"required":["id","kind","wallet_id","algorithm","mode","status","events","metrics"],"type":"object"},"PasswordInput":{"properties":{"password":{"type":"string"}},"required":["password"],"type":"object"},"ResetInput":{"properties":{"confirmation":{"type":"string"}},"required":["confirmation"],"type":"object"},"ResetSummary":{"properties":{"archive_id":{"type":"string"},"devices":{"minimum":0,"type":"integer"},"operations":{"minimum":0,"type":"integer"},"wallets":{"minimum":0,"type":"integer"}},"required":["archive_id","devices","wallets","operations"],"type":"object"},"WalletInfo":{"properties":{"algorithm":{"$ref":"#/components/schemas/Algorithm"},"epoch":{"format":"int32","minimum":0,"type":"integer"},"frozen":{"type":"boolean"},"id":{"type":"string"},"members":{"items":{"type":"string"},"type":"array"},"public_key":{"type":"string"},"ready_presigns":{"minimum":0,"type":"integer"},"threshold":{"format":"int32","minimum":0,"type":"integer"}},"required":["id","algorithm","members","threshold","epoch","public_key","ready_presigns","frozen"],"type":"object"}}},"info":{"description":"软件模拟，备份和硬件未实现；秘密不得进入公开事件。","license":{"name":""},"title":"密钥生命周期本机模拟接口","version":"1.0.0"},"openapi":"3.1.0","paths":{"/api/v1/capabilities":{"get":{"operationId":"capabilities_route","responses":{"200":{"description":"已实现能力及软件限制"}},"tags":[]}},"/api/v1/devices":{"post":{"operationId":"create_device","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceView"}}},"description":""},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleError"}}},"description":""}},"tags":[]}},"/api/v1/devices/{id}/lock":{"post":{"operationId":"lock","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceView"}}},"description":""},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleError"}}},"description":""}},"tags":[]}},"/api/v1/devices/{id}/password":{"post":{"operationId":"change_password","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceView"}}},"description":""},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleError"}}},"description":""}},"tags":[]}},"/api/v1/devices/{id}/unlock":{"post":{"operationId":"unlock","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceView"}}},"description":""},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleError"}}},"description":""}},"tags":[]}},"/api/v1/operations":{"post":{"operationId":"start","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationView"}}},"description":""},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleError"}}},"description":""},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleError"}}},"description":""}},"tags":[]}},"/api/v1/operations/{id}":{"get":{"operationId":"status","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationView"}}},"description":""},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleError"}}},"description":""}},"tags":[]}},"/api/v1/operations/{id}/events":{"get":{"operationId":"events","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"SSE 公开操作快照；id 为最新事件序号"}},"tags":[]}},"/api/v1/operations/{id}/{action}":{"post":{"operationId":"control","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"step, pause, resume, abort","in":"path","name":"action","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationView"}}},"description":""},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleError"}}},"description":""}},"tags":[]}},"/api/v1/state":{"get":{"operationId":"state","responses":{"200":{"description":"全部公开状态"}},"tags":[]}},"/api/v1/wallets/{id}/{action}":{"post":{"operationId":"manage_wallet","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"archive 或 restore；归档作废预签名，保留加密分片","in":"path","name":"action","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedWallet"}}},"description":""},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleError"}}},"description":""}},"tags":[]}},"/api/v1/workspace/reset":{"post":{"operationId":"reset_workspace","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetSummary"}}},"description":""},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleError"}}},"description":""},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleError"}}},"description":""}},"tags":[]}}}}