1

I paid the invoice and then I noticed I paid more than the amount of the invoice.

1201035 (I actually paid) - 1200000 (the amount of the invoice) = 1035 (?)

My questions are..

  1. What is 1035 satoshi? (routing fee..?)
  2. Is it possible to know how much extra amount I will pay before paying.
$ lightning-cli pay lntb12u1pw0ljy4pp55mjg93fckm3ydxsdglp4xxtc8vuc0v79g24gm3rz8h72j8fg32tqdp2xys9xct5da3kx6twv9kk7m3qg3hkccm9ypxxzar5v5cqp5336eqcvsmkx9507p6r82ekralj82jl3npv0v2k8auj2kkgmc9l68mmmzkxvpcnzd3feyygp8hw6wq2qup6f97zfjlm2hzhlk4a9veegqstahde
{
   "id" : 1,
   "payment_hash" : "a6e482c538b6e2469a0d47c35319783b3987b3c542aa8dc4623dfca91d288a96",
   "destination" : "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134",
   "msatoshi" : 1200000,
   "amount_msat" : "1200000msat",
   "msatoshi_sent" : 1201035,
   "amount_sent_msat" : "1201035msat",
   "created_at" : 1560268918,
   "status" : "complete",
   "payment_preimage" : "c718e470dcf429280c611afba095c7396e219d60e590c6ee6beca8042f616483",
   "bolt11" : "lntb12u1pw0ljy4pp55mjg93fckm3ydxsdglp4xxtc8vuc0v79g24gm3rz8h72j8fg32tqdp2xys9xct5da3kx6twv9kk7m3qg3hkccm9ypxxzar5v5cqp5336eqcvsmkx9507p6r82ekralj82jl3npv0v2k8auj2kkgmc9l68mmmzkxvpcnzd3feyygp8hw6wq2qup6f97zfjlm2hzhlk4a9veegqstahde"
}

$ lightning-cli listpeers
{
   "peers" : [
      {
         "id" : "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248",
         "connected" : true,
         "netaddr" : [
            "23.237.77.12:9735"
         ],
         "globalfeatures" : "",
         "localfeatures" : "82",
         "channels" : [
            {
               "state" : "CHANNELD_NORMAL",
               "scratch_txid" : "e7a65a4f1e625a218baf640a154b04bdf06aa922ff1970ee64cbb3f0046b7866",
               "owner" : "lightning_channeld",
               "short_channel_id" : "1542376x20x0",
               "direction" : 1,
               "channel_id" : "6673cb8effd2bae6e0168949fcd8581acd1f6149f0966b568e8900d384f0729c",
               "funding_txid" : "9c72f084d300898e566b96f049611fcd1a58d8fc498916e0e6bad2ff8ecb7366",
               "private" : false,
               "funding_allocation_msat" : {
                  "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248" : 0,
                  "023a41771d55140a27c35687727a4b51bc6b58254129bd216fb000f405b7701cb4" : 20000000
               },
               "funding_msat" : {
                  "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248" : "0msat",
                  "023a41771d55140a27c35687727a4b51bc6b58254129bd216fb000f405b7701cb4" : "20000000msat"
               },
               "msatoshi_to_us" : 18798965,
               "to_us_msat" : "18798965msat",
               "msatoshi_to_us_min" : 18798965,
               "min_to_us_msat" : "18798965msat",
               "msatoshi_to_us_max" : 20000000,
               "max_to_us_msat" : "20000000msat",
               "msatoshi_total" : 20000000,
               "total_msat" : "20000000msat",
               "dust_limit_satoshis" : 546,
               "dust_limit_msat" : "546000msat",
               "max_htlc_value_in_flight_msat" : 18446744073709551615,
               "max_total_htlc_in_msat" : "18446744073709551615msat",
               "their_channel_reserve_satoshis" : 546,
               "their_reserve_msat" : "546000msat",
               "our_channel_reserve_satoshis" : 546,
               "our_reserve_msat" : "546000msat",
               "spendable_msatoshi" : 18252965,
               "spendable_msat" : "18252965msat",
               "htlc_minimum_msat" : 0,
               "minimum_htlc_in_msat" : "0msat",
               "their_to_self_delay" : 6,
               "our_to_self_delay" : 144,
               "max_accepted_htlcs" : 483,
               "status" : [
                  "CHANNELD_NORMAL:Reconnected, and reestablished.",
                  "CHANNELD_NORMAL:Funding transaction locked. Channel announced."
               ],
               "in_payments_offered" : 0,
               "in_msatoshi_offered" : 0,
               "in_offered_msat" : "0msat",
               "in_payments_fulfilled" : 0,
               "in_msatoshi_fulfilled" : 0,
               "in_fulfilled_msat" : "0msat",
               "out_payments_offered" : 2,
               "out_msatoshi_offered" : 2402049,
               "out_offered_msat" : "2402049msat",
               "out_payments_fulfilled" : 1,
               "out_msatoshi_fulfilled" : 1201035,
               "out_fulfilled_msat" : "1201035msat",
               "htlcs" : []
            }
         ]
      }
   ]
}

Update 1

I tried sendpay. Then it worked.

I executed getroute command and I expected the fee was 1022.

After I paid, the amount was decreased 1201022 (the invoice amount + fee) as I expected.

18798965 - 17597943 = 1201022

// before payment
"msatoshi_to_us" : 18798965,

// after payment
"msatoshi_to_us" : 17597943,
// listfunds before payment
$ lightning-cli listfunds
{
   "outputs" : [
      {
         "txid" : "9c72f084d300898e566b96f049611fcd1a58d8fc498916e0e6bad2ff8ecb7366",
         "output" : 1,
         "value" : 92846,
         "amount_msat" : "92846000msat",
         "address" : "tb1qyee36f2jmsytxxymwzc8rps7e7gmkky04lvtz6",
         "status" : "confirmed"
      }
   ],
   "channels" : [
      {
         "peer_id" : "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248",
         "short_channel_id" : "1542376x20x0",
         "channel_sat" : 18798,
         "our_amount_msat" : "18798000msat",
         "channel_total_sat" : 20000,
         "amount_msat" : "20000000msat",
         "funding_txid" : "9c72f084d300898e566b96f049611fcd1a58d8fc498916e0e6bad2ff8ecb7366"
      }
   ]
}

// listpeers before payment
$ lightning-cli listpeers
{
   "peers" : [
      {
         "id" : "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248",
         "connected" : true,
         "netaddr" : [
            "23.237.77.12:9735"
         ],
         "globalfeatures" : "",
         "localfeatures" : "82",
         "channels" : [
            {
               "state" : "CHANNELD_NORMAL",
               "scratch_txid" : "e7a65a4f1e625a218baf640a154b04bdf06aa922ff1970ee64cbb3f0046b7866",
               "owner" : "lightning_channeld",
               "short_channel_id" : "1542376x20x0",
               "direction" : 1,
               "channel_id" : "6673cb8effd2bae6e0168949fcd8581acd1f6149f0966b568e8900d384f0729c",
               "funding_txid" : "9c72f084d300898e566b96f049611fcd1a58d8fc498916e0e6bad2ff8ecb7366",
               "private" : false,
               "funding_allocation_msat" : {
                  "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248" : 0,
                  "023a41771d55140a27c35687727a4b51bc6b58254129bd216fb000f405b7701cb4" : 20000000
               },
               "funding_msat" : {
                  "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248" : "0msat",
                  "023a41771d55140a27c35687727a4b51bc6b58254129bd216fb000f405b7701cb4" : "20000000msat"
               },
               "msatoshi_to_us" : 18798965,
               "to_us_msat" : "18798965msat",
               "msatoshi_to_us_min" : 18798965,
               "min_to_us_msat" : "18798965msat",
               "msatoshi_to_us_max" : 20000000,
               "max_to_us_msat" : "20000000msat",
               "msatoshi_total" : 20000000,
               "total_msat" : "20000000msat",
               "dust_limit_satoshis" : 546,
               "dust_limit_msat" : "546000msat",
               "max_htlc_value_in_flight_msat" : 18446744073709551615,
               "max_total_htlc_in_msat" : "18446744073709551615msat",
               "their_channel_reserve_satoshis" : 546,
               "their_reserve_msat" : "546000msat",
               "our_channel_reserve_satoshis" : 546,
               "our_reserve_msat" : "546000msat",
               "spendable_msatoshi" : 18252965,
               "spendable_msat" : "18252965msat",
               "htlc_minimum_msat" : 0,
               "minimum_htlc_in_msat" : "0msat",
               "their_to_self_delay" : 6,
               "our_to_self_delay" : 144,
               "max_accepted_htlcs" : 483,
               "status" : [
                  "CHANNELD_NORMAL:Reconnected, and reestablished.",
                  "CHANNELD_NORMAL:Funding transaction locked. Channel announced."
               ],
               "in_payments_offered" : 0,
               "in_msatoshi_offered" : 0,
               "in_offered_msat" : "0msat",
               "in_payments_fulfilled" : 0,
               "in_msatoshi_fulfilled" : 0,
               "in_fulfilled_msat" : "0msat",
               "out_payments_offered" : 2,
               "out_msatoshi_offered" : 2402049,
               "out_offered_msat" : "2402049msat",
               "out_payments_fulfilled" : 1,
               "out_msatoshi_fulfilled" : 1201035,
               "out_fulfilled_msat" : "1201035msat",
               "htlcs" : []
            }
         ]
      },
      {
         "id" : "03f44acc1df8639efbe5099da403f213a4ce5bbe6f9bdac7bfa26dcc338761e9de",
         "connected" : true,
         "netaddr" : [
            "207.154.224.115:9735"
         ],
         "globalfeatures" : "",
         "localfeatures" : "81",
         "channels" : []
      }
   ]
}

// getroute
$ lightning-cli getroute 03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134 1200000 0
{
   "route" : [
      {
         "id" : "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248",
         "channel" : "1542376x20x0",
         "direction" : 1,
         "msatoshi" : 1201022,
         "amount_msat" : "1201022msat",
         "delay" : 157
      },
      {
         "id" : "034fe52e98a0e9d3c21b767e1b371881265d8c7578c21f5afd6d6438da10348b36",
         "channel" : "1514318x209x0",
         "direction" : 0,
         "msatoshi" : 1200021,
         "amount_msat" : "1200021msat",
         "delay" : 13
      },
      {
         "id" : "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134",
         "channel" : "1513532x23x1",
         "direction" : 0,
         "msatoshi" : 1200000,
         "amount_msat" : "1200000msat",
         "delay" : 9
      }
   ]
}

// decodepay to get payment_hash
$ lightning-cli decodepay lntb12u1pwsp655pp5rs20fvw8es376wcxxv6u5lxgmh020tlaj77k57rwuzee8qd9a6jqdp2xys9xct5da3kx6twv9kk7m3qg3hkccm9ypxxzar5v5cqp5ufncstk7609dzjg5pm9vjsnf8aphvncpzndup9ly640ggzev76yyazzaxx5uachlp0ld62qlf4qvp7a9w7m4lyagwvehh5cjh2gr90sqet6hjs
{
   "currency" : "tb",
   "created_at" : 1560341140,
   "expiry" : 3600,
   "payee" : "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134",
   "msatoshi" : 1200000,
   "amount_msat" : "1200000msat",
   "description" : "1 Satoccinamon Dolce Latte",
   "min_final_cltv_expiry" : 20,
   "payment_hash" : "1c14f4b1c7cc23ed3b063335ca7cc8dddea7affd97bd6a786ee0b39381a5eea4",
   "signature" : "3045022100e267882eded3cad149140ecac942693f43764f0114dbc097e4d55e840b2cf68802204e885d31a9cee2ff0bfedd281f4d40c0fba577b75f93a873337bd312ba9032be"
}

// sendpay
$ lightning-cli sendpay '[{"id" : "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248","channel" : "1542376x20x0","direction" : 1,"msatoshi" : 1201022,"amount_msat" : "1201022msat","delay" : 157},{"id" : "034fe52e98a0e9d3c21b767e1b371881265d8c7578c21f5afd6d6438da10348b36","channel" : "1514318x209x0","direction" : 0,"msatoshi" : 1200021,"amount_msat" : "1200021msat","delay" : 13},{"id" : "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134","channel" : "1513532x23x1","direction" : 0,"msatoshi" : 1200000,"amount_msat" : "1200000msat","delay" : 9}]' 1c14f4b1c7cc23ed3b063335ca7cc8dddea7affd97bd6a786ee0b39381a5eea4
{
   "message" : "Monitor status with listpayments or waitsendpay",
   "id" : 2,
   "payment_hash" : "1c14f4b1c7cc23ed3b063335ca7cc8dddea7affd97bd6a786ee0b39381a5eea4",
   "destination" : "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134",
   "msatoshi" : 1200000,
   "amount_msat" : "1200000msat",
   "msatoshi_sent" : 1201022,
   "amount_sent_msat" : "1201022msat",
   "created_at" : 1560342528,
   "status" : "pending"
}

// check the status of the payment
$ lightning-cli listpayments
{
   "payments" : [
      {
         "id" : 1,
         "payment_hash" : "a6e482c538b6e2469a0d47c35319783b3987b3c542aa8dc4623dfca91d288a96",
         "destination" : "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134",
         "msatoshi" : 1200000,
         "amount_msat" : "1200000msat",
         "msatoshi_sent" : 1201035,
         "amount_sent_msat" : "1201035msat",
         "created_at" : 1560268918,
         "status" : "complete",
         "payment_preimage" : "c718e470dcf429280c611afba095c7396e219d60e590c6ee6beca8042f616483",
         "bolt11" : "lntb12u1pw0ljy4pp55mjg93fckm3ydxsdglp4xxtc8vuc0v79g24gm3rz8h72j8fg32tqdp2xys9xct5da3kx6twv9kk7m3qg3hkccm9ypxxzar5v5cqp5336eqcvsmkx9507p6r82ekralj82jl3npv0v2k8auj2kkgmc9l68mmmzkxvpcnzd3feyygp8hw6wq2qup6f97zfjlm2hzhlk4a9veegqstahde"
      },
      {
         "id" : 2,
         "payment_hash" : "1c14f4b1c7cc23ed3b063335ca7cc8dddea7affd97bd6a786ee0b39381a5eea4",
         "destination" : "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134",
         "msatoshi" : 1200000,
         "amount_msat" : "1200000msat",
         "msatoshi_sent" : 1201022,
         "amount_sent_msat" : "1201022msat",
         "created_at" : 1560342528,
         "status" : "complete",
         "payment_preimage" : "92ef9e7fd0d7d54565f83e623b8182fdb2884cc6c81071cb8ef3797da4a7efd5"
      }
   ]
}

// listfunds after payment
$ lightning-cli listfunds
{
   "outputs" : [
      {
         "txid" : "9c72f084d300898e566b96f049611fcd1a58d8fc498916e0e6bad2ff8ecb7366",
         "output" : 1,
         "value" : 92846,
         "amount_msat" : "92846000msat",
         "address" : "tb1qyee36f2jmsytxxymwzc8rps7e7gmkky04lvtz6",
         "status" : "confirmed"
      }
   ],
   "channels" : [
      {
         "peer_id" : "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248",
         "short_channel_id" : "1542376x20x0",
         "channel_sat" : 17597,
         "our_amount_msat" : "17597000msat",
         "channel_total_sat" : 20000,
         "amount_msat" : "20000000msat",
         "funding_txid" : "9c72f084d300898e566b96f049611fcd1a58d8fc498916e0e6bad2ff8ecb7366"
      }
   ]
}

// listpeers after payment
$ lightning-cli listpeers
{
   "peers" : [
      {
         "id" : "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248",
         "connected" : true,
         "netaddr" : [
            "23.237.77.12:9735"
         ],
         "globalfeatures" : "",
         "localfeatures" : "82",
         "channels" : [
            {
               "state" : "CHANNELD_NORMAL",
               "scratch_txid" : "743a7677371cea3cb4b75efdb4934ff3a1a8bdce9a152cf9266b057b24c6f300",
               "owner" : "lightning_channeld",
               "short_channel_id" : "1542376x20x0",
               "direction" : 1,
               "channel_id" : "6673cb8effd2bae6e0168949fcd8581acd1f6149f0966b568e8900d384f0729c",
               "funding_txid" : "9c72f084d300898e566b96f049611fcd1a58d8fc498916e0e6bad2ff8ecb7366",
               "private" : false,
               "funding_allocation_msat" : {
                  "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248" : 0,
                  "023a41771d55140a27c35687727a4b51bc6b58254129bd216fb000f405b7701cb4" : 20000000
               },
               "funding_msat" : {
                  "02312627fdf07fbdd7e5ddb136611bdde9b00d26821d14d94891395452f67af248" : "0msat",
                  "023a41771d55140a27c35687727a4b51bc6b58254129bd216fb000f405b7701cb4" : "20000000msat"
               },
               "msatoshi_to_us" : 17597943,
               "to_us_msat" : "17597943msat",
               "msatoshi_to_us_min" : 17597943,
               "min_to_us_msat" : "17597943msat",
               "msatoshi_to_us_max" : 20000000,
               "max_to_us_msat" : "20000000msat",
               "msatoshi_total" : 20000000,
               "total_msat" : "20000000msat",
               "dust_limit_satoshis" : 546,
               "dust_limit_msat" : "546000msat",
               "max_htlc_value_in_flight_msat" : 18446744073709551615,
               "max_total_htlc_in_msat" : "18446744073709551615msat",
               "their_channel_reserve_satoshis" : 546,
               "their_reserve_msat" : "546000msat",
               "our_channel_reserve_satoshis" : 546,
               "our_reserve_msat" : "546000msat",
               "spendable_msatoshi" : 17051943,
               "spendable_msat" : "17051943msat",
               "htlc_minimum_msat" : 0,
               "minimum_htlc_in_msat" : "0msat",
               "their_to_self_delay" : 6,
               "our_to_self_delay" : 144,
               "max_accepted_htlcs" : 483,
               "status" : [
                  "CHANNELD_NORMAL:Reconnected, and reestablished.",
                  "CHANNELD_NORMAL:Funding transaction locked. Channel announced."
               ],
               "in_payments_offered" : 0,
               "in_msatoshi_offered" : 0,
               "in_offered_msat" : "0msat",
               "in_payments_fulfilled" : 0,
               "in_msatoshi_fulfilled" : 0,
               "in_fulfilled_msat" : "0msat",
               "out_payments_offered" : 3,
               "out_msatoshi_offered" : 3603071,
               "out_offered_msat" : "3603071msat",
               "out_payments_fulfilled" : 2,
               "out_msatoshi_fulfilled" : 2402057,
               "out_fulfilled_msat" : "2402057msat",
               "htlcs" : []
            }
         ]
      },
      {
         "id" : "03f44acc1df8639efbe5099da403f213a4ce5bbe6f9bdac7bfa26dcc338761e9de",
         "connected" : true,
         "netaddr" : [
            "207.154.224.115:9735"
         ],
         "globalfeatures" : "",
         "localfeatures" : "81",
         "channels" : []
      }
   ]
}
1

1 Answer 1

5

As you mentioned your question is almost a duplicate of Why does my c-lightning node pay more than the invoice plus routing fees?

But you asked if there is a way of knowing how much you will overpay before you pay.

There are two ways :

  1. You can configure lightningd with a maximum allowed fee for a payment. In that case your node won't use a route with higher fees. However you still don't know the exact routing fee.
  2. You can use sendpay command and specify the onion yourself. You might take a prepared onion from getroute command. In this way you have full control.

From lightning-cli - - help

Sendpay route payment_hash [label] [msatoshi] [bolt11]
  Send along {route} in return for preimage of {payment_hash}
2
  • 4
    It is worth mentioning that by default c-lightning will never pay more than 0.5% of the invoice amount as fee and fuzzing amount combined. In your case it's just slightly above 0.1%
    – cdecker
    Commented Jun 12, 2019 at 5:26
  • Thank you! it worked with sendpay command. I will try the way 1, change maximum fee rate, later.
    – zono
    Commented Jun 12, 2019 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.