forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlightning-createonion.json
168 lines (168 loc) · 10.7 KB
/
lightning-createonion.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "createonion",
"title": "Low-level command to create a custom onion",
"description": [
"The **createonion** RPC command allows the caller to create a custom onion with custom payloads at each hop in the route. A custom onion can be used to implement protocol extensions that are not supported by Core Lightning directly."
],
"request": {
"required": [
"hops",
"assocdata"
],
"additionalProperties": false,
"properties": {
"hops": {
"type": "array",
"description": [
"A JSON list of dicts, each specifying a node and the payload destined for that node."
],
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"pubkey",
"payload"
],
"properties": {
"pubkey": {
"type": "pubkey",
"description": [
"Node pubkey."
]
},
"payload": {
"type": "hex",
"description": [
"Payload to be sent to the node."
]
}
}
}
},
"assocdata": {
"type": "hex",
"description": [
"The associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid."
]
},
"session_key": {
"type": "secret",
"description": [
"Can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned."
]
},
"onion_size": {
"type": "u16",
"description": [
"A size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing."
]
}
}
},
"response": {
"required": [
"onion",
"shared_secrets"
],
"additionalProperties": false,
"properties": {
"onion": {
"type": "hex",
"description": [
"The onion packet (*onion_size* bytes)."
]
},
"shared_secrets": {
"type": "array",
"description": [
"One shared secret for each node in the *hops* parameter."
],
"items": {
"type": "secret",
"description": [
"The shared secret with this hop."
]
}
}
}
},
"author": [
"Christian Decker <<[email protected]>> is mainly responsible."
],
"see_also": [
"lightning-sendonion(7)",
"lightning-getroute(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>",
"",
"[BOLT 04](https://github.com/lightning/bolts/blob/master/04-onion-routing.md)"
],
"examples": [
{
"request": {
"id": "example:createonion#1",
"method": "createonion",
"params": {
"hops": [
{
"pubkey": "nodeid020202020202020202020202020202020202020202020202020202020202",
"payload": "payload010101010101010101010101010"
},
{
"pubkey": "nodeid030303030303030303030303030303030303030303030303030303030303",
"payload": "payload020202020202020202020202020"
},
{
"pubkey": "nodeid040404040404040404040404040404040404040404040404040404040404",
"payload": "payload030303030303030303030303030"
}
],
"assocdata": "assocdata0010101010101010101010101010101010101010101010101010101"
}
},
"response": {
"onion": "onion10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010",
"shared_secrets": [
"sharedsecret1010101010101010101010101010101010101010101010101010",
"sharedsecret1111111111111111111111111111111111111111111111111111",
"sharedsecret1212121212121212121212121212121212121212121212121212"
]
}
},
{
"request": {
"id": "example:createonion#2",
"method": "createonion",
"params": {
"hops": [
{
"pubkey": "nodeid020202020202020202020202020202020202020202020202020202020202",
"payload": "payload010101010101010101010101010"
},
{
"pubkey": "nodeid030303030303030303030303030303030303030303030303030303030303",
"payload": "payload020202020202020202020202020"
},
{
"pubkey": "nodeid040404040404040404040404040404040404040404040404040404040404",
"payload": "payload030303030303030303030303030"
}
],
"assocdata": "assocdata0010101010101010101010101010101010101010101010101010101",
"session_key": "4141414141414141414141414141414141414141414141414141414141414141"
}
},
"response": {
"onion": "onion20202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020",
"shared_secrets": [
"sharedsecret2020202020202020202020202020202020202020202020202020",
"sharedsecret2121212121212121212121212121212121212121212121212121",
"sharedsecret2222222222222222222222222222222222222222222222222222"
]
}
}
]
}