diff --git a/LSPS0/common-schemas.md b/LSPS0/common-schemas.md index ef90d22..a313c36 100644 --- a/LSPS0/common-schemas.md +++ b/LSPS0/common-schemas.md @@ -41,6 +41,9 @@ under this specification. ### Monetary Amounts +###### Link: LSPS0.sat +###### Link: LSPS0.msat + Monetary amounts MUST be expressed in either millisatoshi or satoshi units. @@ -80,6 +83,8 @@ encoded as `"546000"` for an `_msat`-suffixed field, or ### On-chain Feerates +###### Link: LSPS0.onchain_fee_rate + On-chain feerates MUST be expressed in units of millisatoshi per weight unit, or equivalently, satoshi per 1000 weight units (sats/kWU). @@ -93,6 +98,8 @@ For example, the minimum feerate would be encoded as `253`. ### Proportional / Parts-per-million +###### Link: LSPS0.ppm + Proportional numbers (i.e. anything that humans might typically express as a perentage) MUST be expressed in units of parts-per-million. @@ -118,6 +125,8 @@ For example, 0.25% would be encoded as `2500`. ### Short Channel Identifiers (SCID) +###### Link: LSPS0.scid + SCIDs MUST be encoded as a JSON string containing the "human-readable" format of `BBBxTTTxOOO`, as defined in [BOLT7 Definition of `short_channel_id`][]. @@ -139,6 +148,8 @@ encoding, would be written as the JSON string `"539268x845x1"`. ### SECP256K1 Points / Public Keys / Lightning Network Node IDs +###### Link: LSPS0.pubkey + Lightning Network node IDs are SECP256K1 ECC public keys, which are points on the SECP256K1 elliptic curve, as noted in [BOLT8](https://github.com/lightning/bolts/blob/50b7391a6ef5310021c2a6378334e65e04e46876/08-transport.md?plain=1#L5-L6). @@ -172,6 +183,8 @@ as the JSON string ### Lightning Network Connection Strings +###### Link: LSPS0.connection_string + Lightning Network connection strings describe a Lightning Network Node ID and one way to connect to that node. @@ -206,6 +219,8 @@ individually parse and validate each part. ### On-chain Addresses +###### Link: LSPS0.onchain_address + An on-chain address MUST be a SegWit address, from version 0 to any future version. @@ -228,6 +243,8 @@ Readers MAY support other SegWit versions. ### Lightning Network Node Signatures +###### Link: LSPS0.ln_signature + Signatures generated by a particular Lightning Network node, with a particular known node ID, MUST be generated and represented using the [LND `signmessage` #specinatweet][], and encoded as a JSON string @@ -274,6 +291,8 @@ For example, a hypothetical LSPS999 might specify: ### Datetimes +###### Link: LSPS0.datetime + Particular points of time in the modern era (a "datetime") MUST be encoded as a JSON string containing the [ISO 8601][] format `"YYYY-MM-DDThh:mm:ss.uuuZ"`. @@ -283,6 +302,8 @@ These are always in the UTC timezone. ### Binary Blobs (Raw Transactions, PSBTs, Lightning onions, etc.) +###### Link: LSPS0.binary_blob + Binary blobs MUST be encoded as a JSON string containing the Base 64 encoding of the binary blob, as described in [RFC 4648 Section 4][]. @@ -303,3 +324,33 @@ Padding characters `=` MUST be used. > not include the padding `=` characters, despite their > uselessness, as this [tweet](https://twitter.com/fiatjaf/status/1558525040374718465) > laments. + + +## References + +All data types defined here MUST be referenced via the provided anchor link. + +### Example + +The field `min_initial_client_balance_sat` is of data type `LSPS0.sat`. You MUST reference it with an anchor link: + +- `min_initial_client_balance_sat` [][] This field is used to describe the minimal initial channel balance on the client side. + +[]: ./common-schemas.md#link-lsps0sat + +### Convenient Schema +To minimize the characters typed, use the following markdown schema. + +```markdown +- `min_initial_client_balance_sat` [][] This field is used to describe the minimum initial channel balance on the client side. +- `max_initial_client_balance_sat` [][] This field is used to describe the maximum initial channel balance on the client side. +- `onchain_address` [][] On-chain address to pay your fee to. +- `lsp_connection_string` [][] Connection string of the LSP. + +[]: ./common-schemas.md#link-lsps0sat +[]: ./common-schemas.md#link-lsps0onchain_address +[]: ./common-schemas.md#link-lsps0connection_string +``` +`#link-lsps0sat` is the anchor link defined in this doc. It is defined as a h6 header (6 times #). + +`./common-schemas.md` is the relative link to this document and needs to be set individually.