REST
6 min
use rest for standard http integrations with the lnd node behind a node backed deployment setup reminder before calling lnd, collect the node host, the current rest endpoint and port, a least privilege macaroon, and the tls behavior required by the client use configuration docid 9e9fmbsr1zz4nbvl47afl for the complete connection checklist do not copy an endpoint, port, certificate override, or dashboard path from historical documentation without verifying the current node authentication encode the macaroon as a hex string and send it in the grpc metadata macaroon request header store the macaroon as a secret separate read only monitoring credentials from credentials that can create invoices, send funds, change channels, or administer the node do not log request headers, macaroon values, private keys, recovery material, or complete error objects that can expose credentials request and response encoding send json requests with the content type required by the lnd rest endpoint lnd rest represents some byte fields differently from the underlying grpc api when a byte field appears in a path or query parameter, follow the endpoint's rest mapping some values require url safe base64 instead of raw hex or standard base64 treat identifiers, hashes, payment data, and serialized messages as typed values validate their expected encoding before constructing a url first request start with a read only node information or health request verify the node identity and bitcoin network in the response before implementing payment, channel, or wallet operations confirm that authentication failures, tls failures, and unexpected response codes are handled without exposing secrets client behavior use explicit connection and request timeouts retry only operations that are safe to repeat, use bounded exponential backoff, and preserve application level idempotency for payment workflows reuse connections where the client library supports it apply response size limits and parse structured errors before deciding whether to retry, fail, or escalate do not disable tls verification in production isolate any development only override and remove it before deployment monitoring patterns use rest for periodic node information, wallet balances, channel state, fee reports, and other operational reads when streaming is not required track request latency, response status, authentication failure rate, tls failures, timeout rate, and the age of the last successful read a successful http response does not replace reconciliation compare direct node activity with payments and treasury records when the same node backs a payments integration write operations before enabling write calls, document who can create invoices, send funds, open or close channels, change fees, or administer the node use the narrowest credential and smallest tested workflow verify the result with an independent read and capture an audit record that does not contain secrets continue configuration docid 9e9fmbsr1zz4nbvl47afl for endpoint, macaroon, and tls setup grpc docid\ zf545syqrbuqiufluhlpt for generated clients and streaming calls node security docid\ rlda4beej5rlbld3jm2ql and macaroons docid\ gwvwanydfdd27zrsn32pc for access controls resources docid\ uldxo3 oydlivaxfda5lk for official lnd api, repository/proto, and installation references