1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 01:50:03 +01:00

Restrict bitcoin amounts (#908)

It doesn't make sense to exchange amounts that exceed the total bitcoin
supply, so let's make that an explicit requirement.
This commit is contained in:
Bastien Teinturier 2021-09-28 08:33:27 +02:00 committed by GitHub
parent c876dac2b5
commit e832059827
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -225,6 +225,12 @@ integers can be omitted:
* `tu32`: a 0 to 4 byte unsigned integer
* `tu64`: a 0 to 8 byte unsigned integer
When used to encode amounts, the previous fields MUST comply with the upper
bound of 21 million BTC:
* satoshi amounts MUST be at most `0x000775f05a074000`
* milli-satoshi amounts MUST be at most `0x1d24b2dfac520000`
The following convenience types are also defined:
* `chain_hash`: a 32-byte chain identifier (see [BOLT #0](00-introduction.md#glossary-and-terminology-guide))