Files
lightning/doc/schemas/feerates.schema.json
Rusty Russell 64b1ddd761 lightningd: clean up feerate handling, deprecate old terms.
Drop try_get_feerate() in favor of explicit feerate_for_deadline() and
smoothed_feerate_for_deadline().

This shows us everywhere we deal with old-style feerates by names.

`delayed_to_us` and `htlc_resolution` will be moving to dynamic fees,
so deprecate those.

Note that "penalty" is still used for generating penalty txs for
watchtowers, and "unilateral_close" still used until we get zero-fee
anchors.

Changelog-Added: JSON-RPC: `feerates` `estimates` array shows fee estimates by blockcount from underlying plugin (usually *bcli*).
Changelog-Changed: JSON-RPC: `close`, `fundchannel`, `fundpsbt`, `multifundchannel`, `multiwithdraw`, `txprepare`, `upgradewallet`, `withdraw` `feerate` (`feerange` for `close`) value *slow* is now 100 block-estimate, not half of 100-block estimate.
Changelog-Deprecated: JSON-RPC: `close`, `fundchannel`, `fundpsbt`, `multifundchannel`, `multiwithdraw`, `txprepare`, `upgradewallet`, `withdraw` `feerate` (`feerange` for `close`) expressed as, "delayed_to_us", "htlc_resolution", "max_acceptable" or "min_acceptable".  Use explicit block counts or *slow*/*normal*/*urgent*/*minimum*.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-04-10 07:31:12 +09:30

200 lines
7.1 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"warning_missing_feerates": {
"type": "string",
"description": "Some fee estimates are missing"
},
"perkb": {
"type": "object",
"description": "If *style* parameter was perkb",
"additionalProperties": false,
"required": [
"min_acceptable",
"max_acceptable",
"estimates"
],
"properties": {
"min_acceptable": {
"type": "u32",
"description": "The smallest feerate that we allow peers to specify: half the 100-block estimate"
},
"max_acceptable": {
"type": "u32",
"description": "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)."
},
"estimates": {
"type": "array",
"added": "v23.05",
"description": "Feerate estimates from plugin which we are using (usuallly bcli)",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"blockcount",
"feerate",
"smoothed_feerate"
],
"properties": {
"blockcount": {
"type": "u32",
"added": "v23.05",
"description": "The number of blocks the feerate is expected to get a transaction in"
},
"feerate": {
"type": "u32",
"added": "v23.05",
"description": "The feerate for this estimate, in given *style*"
},
"smoothed_feerate": {
"type": "u32",
"added": "v23.05",
"description": "The feerate, smoothed over time (useful for coordinating with other nodes)"
}
}
}
},
"opening": {
"type": "u32",
"description": "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)"
},
"mutual_close": {
"type": "u32",
"description": "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer."
},
"unilateral_close": {
"type": "u32",
"description": "Feerate for commitment_transaction in a live channel which we originally funded"
},
"delayed_to_us": {
"type": "u32",
"deprecated": "v23.05",
"description": "Feerate for returning unilateral close funds to our wallet"
},
"htlc_resolution": {
"type": "u32",
"deprecated": "v23.05",
"description": "Feerate for returning unilateral close HTLC outputs to our wallet"
},
"penalty": {
"type": "u32",
"description": "Feerate to use when creating penalty tx for watchtowers"
}
}
},
"perkw": {
"type": "object",
"description": "If *style* parameter was perkw",
"additionalProperties": false,
"required": [
"min_acceptable",
"max_acceptable",
"estimates"
],
"properties": {
"min_acceptable": {
"type": "u32",
"description": "The smallest feerate that you can use, usually the minimum relayed feerate of the backend"
},
"max_acceptable": {
"type": "u32",
"description": "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)."
},
"estimates": {
"type": "array",
"added": "v23.05",
"description": "Feerate estimates from plugin which we are using (usuallly bcli)",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"blockcount",
"feerate",
"smoothed_feerate"
],
"properties": {
"blockcount": {
"type": "u32",
"added": "v23.05",
"description": "The number of blocks the feerate is expected to get a transaction in"
},
"feerate": {
"type": "u32",
"added": "v23.05",
"description": "The feerate for this estimate, in given *style*"
},
"smoothed_feerate": {
"type": "u32",
"added": "v23.05",
"description": "The feerate, smoothed over time (useful for coordinating with other nodes)"
}
}
}
},
"opening": {
"type": "u32",
"description": "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)"
},
"mutual_close": {
"type": "u32",
"description": "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer."
},
"unilateral_close": {
"type": "u32",
"description": "Feerate for commitment_transaction in a live channel which we originally funded"
},
"delayed_to_us": {
"type": "u32",
"deprecated": "v23.05",
"description": "Feerate for returning unilateral close funds to our wallet"
},
"htlc_resolution": {
"type": "u32",
"deprecated": "v23.05",
"description": "Feerate for returning unilateral close HTLC outputs to our wallet"
},
"penalty": {
"type": "u32",
"description": "Feerate to use when creating penalty tx for watchtowers"
}
}
},
"onchain_fee_estimates": {
"type": "object",
"additionalProperties": false,
"required": [
"opening_channel_satoshis",
"mutual_close_satoshis",
"unilateral_close_satoshis",
"htlc_timeout_satoshis",
"htlc_success_satoshis"
],
"properties": {
"opening_channel_satoshis": {
"type": "u64",
"description": "Estimated cost of typical channel open"
},
"mutual_close_satoshis": {
"type": "u64",
"description": "Estimated cost of typical channel close"
},
"unilateral_close_satoshis": {
"type": "u64",
"description": "Estimated cost of typical (non-anchor) unilateral close (without HTLCs)"
},
"htlc_timeout_satoshis": {
"type": "u64",
"description": "Estimated cost of typical HTLC timeout transaction"
},
"htlc_success_satoshis": {
"type": "u64",
"description": "Estimated cost of typical HTLC fulfillment transaction"
}
}
}
}
}