Skip to content

Instantly share code, notes, and snippets.

@t-bast
Last active April 26, 2022 07:01
Show Gist options
  • Save t-bast/001d12e3011a6ee6a950441f6319be64 to your computer and use it in GitHub Desktop.
Save t-bast/001d12e3011a6ee6a950441f6319be64 to your computer and use it in GitHub Desktop.
When is it more economical to make an on-chain tx rather than an off-chain one?

Economics of making on-chain vs off-chain payments

The fees for on-chain payments are independent of the payment amount, while the fees for off-chain payments are proportional to the amount sent. It is trivial to compute the amount at which it makes more sense to make an on-chain payment.

Parameters used to compute the following numbers:

  • the weight of a 2 inputs, 2 outputs on-chain transaction using p2wpkh is 836 vbytes
  • a route in the lightning network has roughly a median 1000ppm proportional fee

This results in the following thresholds, depending on the on-chain feerate:

On-chain feerate On-chain fees Threshold
1 sat/byte 209 sat 2 mBTC
10 sat/byte 2090 sat 20 mBTC
25 sat/byte 5225 sat 50 mBTC
50 sat/byte 10450 sat 100 mBTC
75 sat/byte 15675 sat 150 mBTC
100 sat/byte 20900 sat 210 mBTC

Any lightning payment above that treshold isn't economical. It does benefit from instant settlement compared to on-chain payments, so it could still make sense depending on the use-case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment