core-lightning/hsmd/hsmd_wire.csv
Rusty Russell 1702c7a69a hsmd: convert to new wire generation style.
Note that other directories were explicitly depending on the generated
file, instead of relying on their (already existing) dependency on 
$(LIGHTNINGD_HSM_CLIENT_OBJS), so we remove that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-08-25 12:53:13 +09:30

7.6 KiB

1# Clients should not give a bad request but not the HSM's decision to crash.
2msgtype,hsmstatus_client_bad_request,1000
3msgdata,hsmstatus_client_bad_request,id,node_id,
4msgdata,hsmstatus_client_bad_request,description,wirestring,
5msgdata,hsmstatus_client_bad_request,len,u16,
6msgdata,hsmstatus_client_bad_request,msg,u8,len
7#include <bitcoin/chainparams.h>
8# Start the HSM.
9msgtype,hsmd_init,11
10msgdata,hsmd_init,bip32_key_version,bip32_key_version,
11msgdata,hsmd_init,chainparams,chainparams,
12msgdata,hsmd_init,hsm_encryption_key,?secret,
13msgdata,hsmd_init,dev_force_privkey,?privkey,
14msgdata,hsmd_init,dev_force_bip32_seed,?secret,
15msgdata,hsmd_init,dev_force_channel_secrets,?secrets,
16msgdata,hsmd_init,dev_force_channel_secrets_shaseed,?sha256,
17#include <common/bip32.h>
18msgtype,hsmd_init_reply,111
19msgdata,hsmd_init_reply,node_id,node_id,
20msgdata,hsmd_init_reply,bip32,ext_key,
21# Get a new HSM FD, with the specified capabilities
22msgtype,hsmd_client_hsmfd,9
23# Which identity to use for requests
24msgdata,hsmd_client_hsmfd,id,node_id,
25# Database id for this client, if any.
26msgdata,hsmd_client_hsmfd,dbid,u64,
27msgdata,hsmd_client_hsmfd,capabilities,u64,
28# No content, just an fd.
29msgtype,hsmd_client_hsmfd_reply,109
30#include <common/derive_basepoints.h>
31# Get the basepoints and funding key for this specific channel.
32msgtype,hsmd_get_channel_basepoints,10
33msgdata,hsmd_get_channel_basepoints,peerid,node_id,
34msgdata,hsmd_get_channel_basepoints,dbid,u64,
35msgtype,hsmd_get_channel_basepoints_reply,110
36msgdata,hsmd_get_channel_basepoints_reply,basepoints,basepoints,
37msgdata,hsmd_get_channel_basepoints_reply,funding_pubkey,pubkey,
38# Return signature for a funding tx.
39#include <common/utxo.h>
40# Master asks the HSM to sign a node_announcement
41msgtype,hsmd_node_announcement_sig_req,6
42msgdata,hsmd_node_announcement_sig_req,annlen,u16,
43msgdata,hsmd_node_announcement_sig_req,announcement,u8,annlen
44msgtype,hsmd_node_announcement_sig_reply,106
45msgdata,hsmd_node_announcement_sig_reply,signature,secp256k1_ecdsa_signature,
46# Sign a withdrawal request
47#include <bitcoin/psbt.h>
48msgtype,hsmd_sign_withdrawal,7
49msgdata,hsmd_sign_withdrawal,num_inputs,u16,
50msgdata,hsmd_sign_withdrawal,inputs,utxo,num_inputs
51msgdata,hsmd_sign_withdrawal,psbt,wally_psbt,
52msgtype,hsmd_sign_withdrawal_reply,107
53msgdata,hsmd_sign_withdrawal_reply,psbt,wally_psbt,
54# Sign an invoice
55msgtype,hsmd_sign_invoice,8
56msgdata,hsmd_sign_invoice,len,u16,
57msgdata,hsmd_sign_invoice,u5bytes,u8,len
58msgdata,hsmd_sign_invoice,hrplen,u16,
59msgdata,hsmd_sign_invoice,hrp,u8,hrplen
60msgtype,hsmd_sign_invoice_reply,108
61msgdata,hsmd_sign_invoice_reply,sig,secp256k1_ecdsa_recoverable_signature,
62# Give me ECDH(node-id-secret,point)
63msgtype,hsmd_ecdh_req,1
64msgdata,hsmd_ecdh_req,point,pubkey,
65msgtype,hsmd_ecdh_resp,100
66msgdata,hsmd_ecdh_resp,ss,secret,
67msgtype,hsmd_cannouncement_sig_req,2
68msgdata,hsmd_cannouncement_sig_req,calen,u16,
69msgdata,hsmd_cannouncement_sig_req,ca,u8,calen
70msgtype,hsmd_cannouncement_sig_reply,102
71msgdata,hsmd_cannouncement_sig_reply,node_signature,secp256k1_ecdsa_signature,
72msgdata,hsmd_cannouncement_sig_reply,bitcoin_signature,secp256k1_ecdsa_signature,
73msgtype,hsmd_cupdate_sig_req,3
74msgdata,hsmd_cupdate_sig_req,culen,u16,
75msgdata,hsmd_cupdate_sig_req,cu,u8,culen
76msgtype,hsmd_cupdate_sig_reply,103
77msgdata,hsmd_cupdate_sig_reply,culen,u16,
78msgdata,hsmd_cupdate_sig_reply,cu,u8,culen
79# Master asks HSM to sign a commitment transaction.
80msgtype,hsmd_sign_commitment_tx,5
81msgdata,hsmd_sign_commitment_tx,peer_id,node_id,
82msgdata,hsmd_sign_commitment_tx,channel_dbid,u64,
83msgdata,hsmd_sign_commitment_tx,tx,bitcoin_tx,
84msgdata,hsmd_sign_commitment_tx,remote_funding_key,pubkey,
85msgtype,hsmd_sign_commitment_tx_reply,105
86msgdata,hsmd_sign_commitment_tx_reply,sig,bitcoin_signature,
87# Onchaind asks HSM to sign a spend to-us. Four variants, since each set
88# of keys is derived differently...
89# FIXME: Have master tell hsmd the keyindex, so it can validate output!
90msgtype,hsmd_sign_delayed_payment_to_us,12
91msgdata,hsmd_sign_delayed_payment_to_us,commit_num,u64,
92msgdata,hsmd_sign_delayed_payment_to_us,tx,bitcoin_tx,
93msgdata,hsmd_sign_delayed_payment_to_us,wscript_len,u16,
94msgdata,hsmd_sign_delayed_payment_to_us,wscript,u8,wscript_len
95msgtype,hsmd_sign_remote_htlc_to_us,13
96msgdata,hsmd_sign_remote_htlc_to_us,remote_per_commitment_point,pubkey,
97msgdata,hsmd_sign_remote_htlc_to_us,tx,bitcoin_tx,
98msgdata,hsmd_sign_remote_htlc_to_us,wscript_len,u16,
99msgdata,hsmd_sign_remote_htlc_to_us,wscript,u8,wscript_len
100msgdata,hsmd_sign_remote_htlc_to_us,option_anchor_outputs,bool,
101msgtype,hsmd_sign_penalty_to_us,14
102msgdata,hsmd_sign_penalty_to_us,revocation_secret,secret,
103msgdata,hsmd_sign_penalty_to_us,tx,bitcoin_tx,
104msgdata,hsmd_sign_penalty_to_us,wscript_len,u16,
105msgdata,hsmd_sign_penalty_to_us,wscript,u8,wscript_len
106# Onchaind asks HSM to sign a local HTLC success or HTLC timeout tx.
107msgtype,hsmd_sign_local_htlc_tx,16
108msgdata,hsmd_sign_local_htlc_tx,commit_num,u64,
109msgdata,hsmd_sign_local_htlc_tx,tx,bitcoin_tx,
110msgdata,hsmd_sign_local_htlc_tx,wscript_len,u16,
111msgdata,hsmd_sign_local_htlc_tx,wscript,u8,wscript_len
112msgdata,hsmd_sign_local_htlc_tx,option_anchor_outputs,bool,
113# Openingd/channeld asks HSM to sign the other sides' commitment tx.
114msgtype,hsmd_sign_remote_commitment_tx,19
115msgdata,hsmd_sign_remote_commitment_tx,tx,bitcoin_tx,
116msgdata,hsmd_sign_remote_commitment_tx,remote_funding_key,pubkey,
117msgdata,hsmd_sign_remote_commitment_tx,remote_per_commit,pubkey,
118msgdata,hsmd_sign_remote_commitment_tx,option_static_remotekey,bool,
119# channeld asks HSM to sign remote HTLC tx.
120msgtype,hsmd_sign_remote_htlc_tx,20
121msgdata,hsmd_sign_remote_htlc_tx,tx,bitcoin_tx,
122msgdata,hsmd_sign_remote_htlc_tx,len,u16,
123msgdata,hsmd_sign_remote_htlc_tx,wscript,u8,len
124msgdata,hsmd_sign_remote_htlc_tx,remote_per_commit_point,pubkey,
125msgdata,hsmd_sign_remote_htlc_tx,option_anchor_outputs,bool,
126# closingd asks HSM to sign mutual close tx.
127msgtype,hsmd_sign_mutual_close_tx,21
128msgdata,hsmd_sign_mutual_close_tx,tx,bitcoin_tx,
129msgdata,hsmd_sign_mutual_close_tx,remote_funding_key,pubkey,
130# Reply for all the above requests.
131msgtype,hsmd_sign_tx_reply,112
132msgdata,hsmd_sign_tx_reply,sig,bitcoin_signature,
133# Openingd/channeld/onchaind asks for Nth per_commitment_point, if > 2, gets N-2 secret.
134msgtype,hsmd_get_per_commitment_point,18
135msgdata,hsmd_get_per_commitment_point,n,u64,
136msgtype,hsmd_get_per_commitment_point_reply,118
137msgdata,hsmd_get_per_commitment_point_reply,per_commitment_point,pubkey,
138msgdata,hsmd_get_per_commitment_point_reply,old_commitment_secret,?secret,
139# master -> hsmd: do you have a memleak?
140msgtype,hsmd_dev_memleak,33
141msgtype,hsmd_dev_memleak_reply,133
142msgdata,hsmd_dev_memleak_reply,leak,bool,
143# channeld asks to check if claimed future commitment_secret is correct.
144msgtype,hsmd_check_future_secret,22
145msgdata,hsmd_check_future_secret,n,u64,
146msgdata,hsmd_check_future_secret,commitment_secret,secret,
147msgtype,hsmd_check_future_secret_reply,122
148msgdata,hsmd_check_future_secret_reply,correct,bool,
149# lightningd asks us to sign a string.
150msgtype,hsmd_sign_message,23
151msgdata,hsmd_sign_message,len,u16,
152msgdata,hsmd_sign_message,msg,u8,len
153msgtype,hsmd_sign_message_reply,123
154msgdata,hsmd_sign_message_reply,sig,secp256k1_ecdsa_recoverable_signature,
155# lightningd needs to get a scriptPubkey for a utxo with closeinfo
156msgtype,hsmd_get_output_scriptpubkey,24
157msgdata,hsmd_get_output_scriptpubkey,channel_id,u64,
158msgdata,hsmd_get_output_scriptpubkey,peer_id,node_id,
159msgdata,hsmd_get_output_scriptpubkey,commitment_point,?pubkey,
160msgtype,hsmd_get_output_scriptpubkey_reply,124
161msgdata,hsmd_get_output_scriptpubkey_reply,script_len,u16,
162msgdata,hsmd_get_output_scriptpubkey_reply,script,u8,script_len