Invoice

From lightningwiki.net
Revision as of 01:37, 12 February 2019 by 173.87.33.113 (talk)
Jump to: navigation, search

A request for funds on the Lightning Network, possibly including payment type, payment amount, expiry, and other information. This is how payments are made on the Lightning Network, rather than using Bitcoin-style addresses.

If you want to accept payments (on your site), look at Payment providers

Payments process

Template:TODO

  1. Someone creates an invoice
  2. Invoice is paid
  3. Payment is done!

Payment steps using LND command line

1. The Payee starts the process by creating an invoice note: The amount to send is always expressed in Satoshis (1 satoshi = .00000001 bitcoin) so in this example the payee creates an invoice for 50,000 satoshis (or .0005 bitcoin).

        $ lncli addinvoice --amt 50000

2. The payee then sends the invoice to the payer, which decodes the invoice to verify the amount (see the 'data in invoice' below)

        $ lncli decodepayreq <paste invoice here>

3. The payer then pays the invoice

        $ lncli payinvoice <paste invoice here>
  • That's it! Also note, the decodepayreq step can normally be skipped since when you pay the invoice you are prompted to confirm the amount before it is sent

Data in invoice

  "destination": "03ab75012c0a552ddb0194f43d57d9af2a83a86cc2a96abf0134c6d9349819c8a8",
    "payment_hash": "8d54fb2afe6e35f36f3e6055fa062b2f3fd11e67b0d287618471477fde80f3a2",
    "num_satoshis": "0",
    "timestamp": "1546608429",
    "expiry": "3600",
    "description": "Lightning Network Tester",
    "description_hash": "",
    "fallback_addr": "",
    "cltv_expiry": "10",
    "route_hints": [
    ]

Payment preimage

Proof that payment has been received, held by the final recipient, who is the only person who knows this secret. The final recipient releases the preimage in order to release funds. The payment preimage is hashed as the payment hash in the HTLC.

Example

lnbc1pwr3fk2pp5zh36fav42ngkxfzywag42y06e03drpcujg38mq5gzkftdhp3phhsdqqcqzysvq8mgc5782mje6x0hgqd70pc83aa52g8pmpnc0j9x4pa3hrz3csp0ezl477f06ee4qmt4plcmmsftypy727w9zn06h9h6cz4n02t9qcp0c74yt

BOLT11 has more