|
108 | 108 | "* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`.", |
109 | 109 | "Every other operator except `#` fails if *name* does not exist!" |
110 | 110 | ], |
| 111 | + "sharing_runes": [ |
| 112 | + "Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.", |
| 113 | + "", |
| 114 | + "If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if your rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute." |
| 115 | + ], |
| 116 | + "author": [ |
| 117 | + "Rusty Russell <<[email protected]>> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", |
| 118 | + "", |
| 119 | + "Shahana Farooqui <<[email protected]>> is mainly responsible for migrating commando-rune to createrune." |
| 120 | + ], |
| 121 | + "see_also": [ |
| 122 | + "lightning-commando-rune(7)", |
| 123 | + "lightning-checkrune(7)" |
| 124 | + ], |
| 125 | + "resources": [ |
| 126 | + "Main web site: <https://github.com/ElementsProject/lightning>" |
| 127 | + ], |
111 | 128 | "usage": [ |
112 | | - "You can use lightning-decode(7) to examine runes you have been given:", |
| 129 | + "- You can use lightning-decode(7) to examine runes you have been given:", |
113 | 130 | "", |
114 | 131 | "```shell", |
115 | 132 | "lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y", |
|
158 | 175 | " ],", |
159 | 176 | " \"valid\": true", |
160 | 177 | "}", |
161 | | - "```" |
162 | | - ], |
163 | | - "sharing_runes": [ |
164 | | - "Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.", |
| 178 | + "```", |
165 | 179 | "", |
166 | | - "If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute." |
167 | | - ], |
168 | | - "author": [ |
169 | | - "Rusty Russell <<[email protected]>> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.", |
| 180 | + "- You can use lightning-checkrune(7) to verify whether a rune is valid for a specific method and its parameters:", |
170 | 181 | "", |
171 | | - "Shahana Farooqui <<[email protected]>> is mainly responsible for migrating commando-rune to createrune." |
172 | | - ], |
173 | | - "see_also": [ |
174 | | - "lightning-commando-rune(7)", |
175 | | - "lightning-checkrune(7)" |
176 | | - ], |
177 | | - "resources": [ |
178 | | - "Main web site: <https://github.com/ElementsProject/lightning>" |
| 182 | + "```shell", |
| 183 | + "lightning-cli checkrune -k 'rune'=tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y 'method'='invoice' 'params'='{\"amount_msat\": 100000001, \"label\": \"invoicelabel\"', \"description\": \"Checking rune validity\"}'", |
| 184 | + "```" |
179 | 185 | ], |
180 | 186 | "examples": [ |
181 | 187 | { |
|
369 | 375 | "rune": "GJb2PC-4jYslzIVz6-425bOtpkz_A_zaEhekPlrXdj09NCZpZD0wMjY2ZTQ1OThkMWQzYzQxNWY1NzJhODQ4ODgzMGI2MGY3ZTc0NGVkOTIzNWViMGIxYmE5MzI4M2IzMTVjMDM1MTgmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjY2ZTQ1OThkMWQzYzQxNWY1N3xwYXJyMF4wMjY2ZTQ1OThkMWQzYzQxNWY1NyZ0aW1lPCIkKCgkKGRhdGUgKyVzKSArIDI0KjYwKjYwKSkifHJhdGU9Mg==", |
370 | 376 | "unique_id": "4" |
371 | 377 | } |
| 378 | + }, |
| 379 | + { |
| 380 | + "description": [ |
| 381 | + "Now, let us create a rune with `read-only` restrictions, extended to only allow sending payments of `less than 100,000 sats per day` using either the `pay` or `xpay` method. Ideally, the condition would look something like:", |
| 382 | + "", |
| 383 | + "`[[\"method^list or method^get or ((method=pay or method=xpay) and per=1day and pnameamount\\_msat<100000001)\"],[\"method/listdatastore\"]]`.", |
| 384 | + "", |
| 385 | + "However, since brackets and AND conditions within OR are currently not supported for rune creation, we can restructure the conditions as follows:", |
| 386 | + "", |
| 387 | + "- method^list|method^get|method=summary|method=pay|method=xpay", |
| 388 | + "- method/listdatastore", |
| 389 | + "- method/pay|per=1day", |
| 390 | + "- method/pay|pnameamount\\_msat<100000001", |
| 391 | + "- method/xpay|per=1day", |
| 392 | + "- method/xpay|pnameamount\\_msat<100000001" |
| 393 | + ], |
| 394 | + "request": { |
| 395 | + "id": "example:createrune#9", |
| 396 | + "method": "createrune", |
| 397 | + "params": { |
| 398 | + "restrictions": [ |
| 399 | + [ |
| 400 | + "method^list", |
| 401 | + "method^get", |
| 402 | + "method=summary", |
| 403 | + "method=pay", |
| 404 | + "method=xpay" |
| 405 | + ], |
| 406 | + [ |
| 407 | + "method/listdatastore" |
| 408 | + ], |
| 409 | + [ |
| 410 | + "method/pay", |
| 411 | + "per=1day" |
| 412 | + ], |
| 413 | + [ |
| 414 | + "method/pay", |
| 415 | + "pnameamount_msat<100000001" |
| 416 | + ], |
| 417 | + [ |
| 418 | + "method/xpay", |
| 419 | + "per=1day" |
| 420 | + ], |
| 421 | + [ |
| 422 | + "method/xpay", |
| 423 | + "pnameamount_msat<100000001" |
| 424 | + ] |
| 425 | + ] |
| 426 | + } |
| 427 | + }, |
| 428 | + "response": { |
| 429 | + "rune": "iP1FQEsFmPsu-XW7w8uXIJaJb7jU9PqOfkmXlOyWMuA9NSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5fG1ldGhvZD1wYXl8bWV0aG9kPXhwYXkmbWV0aG9kL2xpc3RkYXRhc3RvcmUmbWV0aG9kL3BheXxwZXI9MWRheSZtZXRob2QvcGF5fHBuYW1lYW1vdW50X21zYXQ8MTAwMDAwMDAxJm1ldGhvZC94cGF5fHBlcj0xZGF5Jm1ldGhvZC94cGF5fHBuYW1lYW1vdW50X21zYXQ8MTAwMDAwMDAx", |
| 430 | + "unique_id": "5" |
| 431 | + } |
372 | 432 | } |
373 | 433 | ] |
374 | 434 | } |
0 commit comments