Difference between revisions of "Invoice"

From lightningwiki.net
Jump to navigation Jump to search
Tag: Undo
 
(6 intermediate revisions by 3 users not shown)
Line 4: Line 4:


=Payments process=
=Payments process=
{{TODO|Explain how a payment is done}}
{{HELP|Explain how a payment is done}}
# Someone creates an invoice
# Someone creates an invoice
# Invoice is paid
# Invoice is paid
Line 10: Line 10:
=Payment steps using LND command line=
=Payment steps using LND command line=
1. The Payee starts the process by creating an invoice  
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).
note: The amount to send is always expressed in [[Satoshi|Satoshi]] (1 satoshi = .00000001 bitcoin) so in this example the payee creates an invoice for 50,000 satoshis (or .0005 bitcoin).
         $ lncli addinvoice --amt 50000
         $ 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)
2. The payee then sends the invoice to the payer, which decodes the invoice to verify the amount (see the 'data in invoice' below)
Line 36: Line 36:
==Payment preimage==
==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.
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.
= Limits and maximum size =
* Max payment allowed is 0.04294967 BTC ([[lnd]])
* The payment may take 1 route only, until [[AMP]] is implemented.


=Example=
=Example=
<pre>lnbc1pwr3fk2pp5zh36fav42ngkxfzywag42y06e03drpcujg38mq5gzkftdhp3phhsdqqcqzysvq8mgc5782mje6x0hgqd70pc83aa52g8pmpnc0j9x4pa3hrz3csp0ezl477f06ee4qmt4plcmmsftypy727w9zn06h9h6cz4n02t9qcp0c74yt</pre>
<pre>lnbc1pwr3fk2pp5zh36fav42ngkxfzywag42y06e03drpcujg38mq5gzkftdhp3phhsdqqcqzysvq8mgc5782mje6x0hgqd70pc83aa52g8pmpnc0j9x4pa3hrz3csp0ezl477f06ee4qmt4plcmmsftypy727w9zn06h9h6cz4n02t9qcp0c74yt</pre>
BOLT11 has more
BOLT11 has more

Latest revision as of 06:47, 2 November 2020

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

Error creating thumbnail: File missing
Please help by adding more information. Suggestion:
Explain how a payment is done
  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 Satoshi (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.

Limits and maximum size

  • Max payment allowed is 0.04294967 BTC (lnd)
  • The payment may take 1 route only, until AMP is implemented.


Example

lnbc1pwr3fk2pp5zh36fav42ngkxfzywag42y06e03drpcujg38mq5gzkftdhp3phhsdqqcqzysvq8mgc5782mje6x0hgqd70pc83aa52g8pmpnc0j9x4pa3hrz3csp0ezl477f06ee4qmt4plcmmsftypy727w9zn06h9h6cz4n02t9qcp0c74yt

BOLT11 has more