[c-lightning] Moving to amount unification in JSON APIs

Rusty Russell rusty at rustcorp.com.au
Wed Jan 23 09:38:04 AEDT 2019

Hi all,

        A common complaint for c-lightning, and a mistake I've made
myself, is using satoshis in APIs that take millisatoshis.  All onchain
commands (eg. fundchannel) use satoshis, and lightning commands
(eg. invoice, pay) use millisatoshis.

This is generally spelled out in the parameter name (satoshi or
msatoshi), but that doesn't help those of us who use parameters by order
not keyword!

So, for the next version I want to add optional suffixes: 'btc', 'sat'
or 'msat'.  We would also require us handling decimal amounts, and fail
if you specify more accuracy than we support (eg. 1000000.1sat to

I may also require exactly 8 or 11 decimals for btc with '.', and 3 for
sat with '.', the first of which copies bitcoind's format for btc.

Any bikeshedding to add?  Either the names or other details?


More information about the c-lightning mailing list