lightning-checkrune

lightning-checkrune -- Command to Validate Rune

SYNOPSIS

checkrune rune [nodeid] [method] [params]

DESCRIPTION

Command added in v23.08.

The checkrune RPC command checks the validity/authorization rights of specified rune for the given nodeid, method, and params.

If successful, the rune "usage" counter (used for ratelimiting) is incremented.

See lightning-createrune(7) for the fields in the rune which are checked.

  • rune (string): Rune to check for authorization.
  • nodeid (string, optional): Node id of requesting node (required until v23.11).
  • method (string, optional): Method for which rune needs to be validated (required until v23.11).
  • params (one of, optional):
    • (array): Array of positional parameters.
    • (object): Parameters for method.:

RETURN VALUE

On success, an object is returned, containing:

  • valid (boolean): True if the rune is valid.

ERRORS

The following error codes may occur:

  • 1501 (RUNE_NOT_AUTHORIZED): rune is not for this node (or perhaps completely invalid)
  • 1502 (RUNE_NOT_PERMITTED): rune does not allow this usage (includes a detailed reason why)
  • 1503 (RUNE_BLACKLISTED): rune has been explicitly blacklisted.

AUTHOR

Shahana Farooqui <[email protected]> is mainly responsible for consolidating logic from commando.

SEE ALSO

lightning-createrune(7), lightning-blacklistrune(7)

RESOURCES

Main web site: https://github.com/ElementsProject/lightning

EXAMPLES

Example 1:

Request:

lightning-cli checkrune -k "nodeid"="nodeid020202020202020202020202020202020202020202020202020202020202" "rune"="_RWaZZRI7wAYU2hqlFBmYgC_dFczcpAdI_9O87YbDpg9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl" "method"="listpeers" "params"='{}'
{
  "id": "example:checkrune#1",
  "method": "checkrune",
  "params": {
    "nodeid": "nodeid020202020202020202020202020202020202020202020202020202020202",
    "rune": "_RWaZZRI7wAYU2hqlFBmYgC_dFczcpAdI_9O87YbDpg9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl",
    "method": "listpeers",
    "params": {}
  }
}

Response:

{
  "valid": true
}

Example 2:

Request:

lightning-cli checkrune -k "nodeid"="nodeid020202020202020202020202020202020202020202020202020202020202" "rune"="QUJEYMLGgiaJvMDv_MhR2hiMKIBTbq-PrL-KxcIlirQ9MiZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==" "method"="pay" "params"='{"amount_msat": 9999}'
{
  "id": "example:checkrune#2",
  "method": "checkrune",
  "params": {
    "nodeid": "nodeid020202020202020202020202020202020202020202020202020202020202",
    "rune": "QUJEYMLGgiaJvMDv_MhR2hiMKIBTbq-PrL-KxcIlirQ9MiZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==",
    "method": "pay",
    "params": {
      "amount_msat": 9999
    }
  }
}

Response:

{
  "valid": true
}

Core Lightning (previously c-lightning) is a lightweight, highly customizable and standard compliant implementation of the Lightning Network protocol.

© 2023 Core Lightning
All rights reserved.

Discussion Forum

The official Core Lightning forum is hosted at discuss.corelightning.org

BuildonL2 Community

The official BuildOnL2 community lives at community.corelightning.org. Join us and build the future of bitcoin on lightning.

Mailing List

For general discussions about CLN implementation, use [email protected]. For the Lightning Network, use [email protected]

Telegram

Community-driven telegram group where most of the node operators hang out. Go to https://t.me/lightningd to join.

Discord

Community-driven discord server where the devs flock together. Go to https://discord.gg/w27fMFESMN to join.

Internet Relay Chat

Don't hesitate to reach out to us on IRC at #lightning-dev @ libera.chat, #c-lightning @ libera.chat.