core-lightning/connectd/connectd_wire.csv
Rusty Russell 5becfa6ee1 onion_message: don't use general secret, use per-message secret.
We had a scheme where lightningd itself would put a per-node secret in
the blinded path, then we'd tell the caller when it was used.  Then it
simply checks the alias to determine if the correct path was used.

But this doesn't work when we start to offer multiple blinded paths.
So go for a far simpler scheme, where the secret is generated (and
stored) by the caller, and hand it back to them.

We keep the split "with secret" or "without secret" API, since I'm
sure callers who don't care about the secret won't check that it
doesn't exist!  And without that, someone can use a blinded path for a
different message and get a response which may reveal the node.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-11-09 15:08:03 +01:00

5.6 KiB

1#include <bitcoin/block.h>
2#include <common/channel_id.h>
3#include <common/cryptomsg.h>
4#include <common/features.h>
5#include <common/node_id.h>
6#include <common/wireaddr.h>
7#include <wire/onion_wire.h>
8msgtype,connectd_init,2000
9msgdata,connectd_init,chainparams,chainparams,
10msgdata,connectd_init,our_features,feature_set,
11msgdata,connectd_init,id,node_id,
12msgdata,connectd_init,num_wireaddrs,u16,
13msgdata,connectd_init,wireaddrs,wireaddr_internal,num_wireaddrs
14msgdata,connectd_init,listen_announce,enum addr_listen_announce,num_wireaddrs
15msgdata,connectd_init,tor_proxyaddr,?wireaddr,
16msgdata,connectd_init,use_tor_proxy_always,bool,
17msgdata,connectd_init,dev_allow_localhost,bool,
18msgdata,connectd_init,use_dns,bool,
19msgdata,connectd_init,tor_password,wirestring,
20msgdata,connectd_init,timeout_secs,u32,
21msgdata,connectd_init,websocket_helper,wirestring,
22msgdata,connectd_init,websocket_port,u16,
23msgdata,connectd_init,announce_websocket,bool,
24msgdata,connectd_init,dev_fast_gossip,bool,
25# If this is set, then fd 5 is dev_disconnect_fd.
26msgdata,connectd_init,dev_disconnect,bool,
27msgdata,connectd_init,dev_no_ping_timer,bool,
28# Connectd->master, here are the addresses I bound, can announce.
29msgtype,connectd_init_reply,2100
30msgdata,connectd_init_reply,num_bindings,u16,
31msgdata,connectd_init_reply,bindings,wireaddr_internal,num_bindings
32msgdata,connectd_init_reply,num_announceable,u16,
33msgdata,connectd_init_reply,announceable,wireaddr,num_announceable
34msgdata,connectd_init_reply,failmsg,?wirestring,
35# Activate the connect daemon, so others can connect.
36msgtype,connectd_activate,2025
37# Do we listen?
38msgdata,connectd_activate,listen,bool,
39# Connectd->master, I am ready.
40msgtype,connectd_activate_reply,2125
41msgdata,connectd_activate_reply,failmsg,?wirestring,
42# Master -> connectd: connect to a peer.
43msgtype,connectd_connect_to_peer,2001
44msgdata,connectd_connect_to_peer,id,node_id,
45msgdata,connectd_connect_to_peer,len,u32,
46msgdata,connectd_connect_to_peer,addrs,wireaddr,len
47msgdata,connectd_connect_to_peer,addrhint,?wireaddr_internal,
48# Connectd->master: connect failed.
49msgtype,connectd_connect_failed,2020
50msgdata,connectd_connect_failed,id,node_id,
51msgdata,connectd_connect_failed,failcode,enum jsonrpc_errcode,
52msgdata,connectd_connect_failed,failreason,wirestring,
53msgdata,connectd_connect_failed,addrhint,?wireaddr_internal,
54# Connectd -> master: we got a peer.
55msgtype,connectd_peer_connected,2002
56msgdata,connectd_peer_connected,id,node_id,
57msgdata,connectd_peer_connected,counter,u64,
58msgdata,connectd_peer_connected,addr,wireaddr_internal,
59msgdata,connectd_peer_connected,remote_addr,?wireaddr,
60msgdata,connectd_peer_connected,incoming,bool,
61msgdata,connectd_peer_connected,flen,u16,
62msgdata,connectd_peer_connected,features,u8,flen
63# connectd -> master: peer disconnected.
64msgtype,connectd_peer_disconnect_done,2006
65msgdata,connectd_peer_disconnect_done,id,node_id,
66msgdata,connectd_peer_disconnect_done,counter,u64,
67# Master -> connectd: make peer active immediately (we want to talk) (+ fd to subd).
68msgtype,connectd_peer_connect_subd,2004
69msgdata,connectd_peer_connect_subd,id,node_id,
70msgdata,connectd_peer_connect_subd,counter,u64,
71msgdata,connectd_peer_connect_subd,channel_id,channel_id,
72# Connectd -> master: peer said something interesting
73msgtype,connectd_peer_spoke,2005
74msgdata,connectd_peer_spoke,id,node_id,
75msgdata,connectd_peer_spoke,counter,u64,
76msgdata,connectd_peer_spoke,msgtype,u16,
77msgdata,connectd_peer_spoke,channel_id,channel_id,
78# master -> connectd: peer no longer wanted, you can disconnect.
79msgtype,connectd_discard_peer,2015
80msgdata,connectd_discard_peer,id,node_id,
81msgdata,connectd_discard_peer,counter,u64,
82# master -> connectd: give message to peer and disconnect.
83msgtype,connectd_peer_final_msg,2003
84msgdata,connectd_peer_final_msg,id,node_id,
85msgdata,connectd_peer_final_msg,counter,u64,
86msgdata,connectd_peer_final_msg,len,u16,
87msgdata,connectd_peer_final_msg,msg,u8,len
88# master -> connectd: do you have a memleak?
89msgtype,connectd_dev_memleak,2033
90msgtype,connectd_dev_memleak_reply,2133
91msgdata,connectd_dev_memleak_reply,leak,bool,
92# Ping/pong test. Waits for a reply if it expects one.
93msgtype,connectd_ping,2030
94msgdata,connectd_ping,id,node_id,
95msgdata,connectd_ping,num_pong_bytes,u16,
96msgdata,connectd_ping,len,u16,
97msgtype,connectd_ping_reply,2130
98# False if we there was already a ping in progress.
99msgdata,connectd_ping_reply,sent,bool,
100# 0 == no pong expected, otherwise length of pong.
101msgdata,connectd_ping_reply,totlen,u16,
102# We tell lightningd we got an onionmsg
103msgtype,connectd_got_onionmsg_to_us,2145
104msgdata,connectd_got_onionmsg_to_us,path_secret,?secret,
105msgdata,connectd_got_onionmsg_to_us,reply,?blinded_path,
106msgdata,connectd_got_onionmsg_to_us,rawmsg_len,u16,
107msgdata,connectd_got_onionmsg_to_us,rawmsg,u8,rawmsg_len
108# Lightningd tells us to send an onion message.
109msgtype,connectd_send_onionmsg,2041
110msgdata,connectd_send_onionmsg,id,node_id,
111msgdata,connectd_send_onionmsg,onion_len,u16,
112msgdata,connectd_send_onionmsg,onion,u8,onion_len
113msgdata,connectd_send_onionmsg,blinding,pubkey,
114# A custom message that we got from a peer and don't know how to handle, so we
115# forward it to the master for further handling.
116msgtype,connectd_custommsg_in,2110
117msgdata,connectd_custommsg_in,id,node_id,
118msgdata,connectd_custommsg_in,msg_len,u16,
119msgdata,connectd_custommsg_in,msg,u8,msg_len
120# A custom message that the lightningd tells us to send to the peer.
121msgtype,connectd_custommsg_out,2011
122msgdata,connectd_custommsg_out,id,node_id,
123msgdata,connectd_custommsg_out,msg_len,u16,
124msgdata,connectd_custommsg_out,msg,u8,msg_len
125# master -> connect: stop sending gossip.
126msgtype,connectd_dev_suppress_gossip,2032