core-lightning/hsmd/hsm_wire.csv
Rusty Russell ef28b6112c status: use common status codes for all the failures.
This change is really to allow us to have a --dev-fail-on-subdaemon-fail option
so we can handle failures from subdaemons generically.

It also neatens handling so we can have an explicit callback for "peer
did something wrong" (which matters if we want to close the channel in
that case).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-09-12 23:00:53 +02:00

2.0 KiB

1# Clients should not give a bad request but not the HSM's decision to crash.
2hsmstatus_client_bad_request,1000
3hsmstatus_client_bad_request,,unique_id,8
4hsmstatus_client_bad_request,,len,2
5hsmstatus_client_bad_request,,msg,len*u8
6# Start the HSM.
7hsmctl_init,1
8hsmctl_init,,new,bool
9#include <common/bip32.h>
10hsmctl_init_reply,101
11hsmctl_init_reply,,node_id,33
12hsmctl_init_reply,,peer_seed,struct secret
13hsmctl_init_reply,,bip32,struct ext_key
14# ECDH returns an fd.
15hsmctl_hsmfd_ecdh,3
16hsmctl_hsmfd_ecdh,,unique_id,8
17# No contents, just an fd.
18hsmctl_hsmfd_ecdh_fd_reply,103
19# Return signature for a funding tx.
20#include <common/utxo.h>
21# FIXME: This should also take their commit sig & details, to verify.
22hsmctl_sign_funding,4
23hsmctl_sign_funding,,satoshi_out,8
24hsmctl_sign_funding,,change_out,8
25hsmctl_sign_funding,,change_keyindex,4
26hsmctl_sign_funding,,our_pubkey,33
27hsmctl_sign_funding,,their_pubkey,33
28hsmctl_sign_funding,,num_inputs,2
29hsmctl_sign_funding,,inputs,num_inputs*struct utxo
30hsmctl_sign_funding_reply,104
31hsmctl_sign_funding_reply,,num_sigs,2
32hsmctl_sign_funding_reply,,sig,num_sigs*secp256k1_ecdsa_signature
33# Request a client socket for a `channeld`, allows signing announcements
34hsmctl_hsmfd_channeld,5
35hsmctl_hsmfd_channeld,,unique_id,8
36# Empty reply, just an fd
37hsmctl_hsmfd_channeld_reply,105
38# Master asks the HSM to sign a node_announcement
39hsmctl_node_announcement_sig_req,6
40hsmctl_node_announcement_sig_req,,annlen,2
41hsmctl_node_announcement_sig_req,,announcement,annlen*u8
42hsmctl_node_announcement_sig_reply,106
43hsmctl_node_announcement_sig_reply,,signature,secp256k1_ecdsa_signature
44# Sign a withdrawal request
45hsmctl_sign_withdrawal,7
46hsmctl_sign_withdrawal,,satoshi_out,8
47hsmctl_sign_withdrawal,,change_out,8
48hsmctl_sign_withdrawal,,change_keyindex,4
49hsmctl_sign_withdrawal,,pkh,20*u8
50hsmctl_sign_withdrawal,,num_inputs,2
51hsmctl_sign_withdrawal,,inputs,num_inputs*struct utxo
52hsmctl_sign_withdrawal_reply,107
53hsmctl_sign_withdrawal_reply,,num_sigs,2
54hsmctl_sign_withdrawal_reply,,sig,num_sigs*secp256k1_ecdsa_signature