/// spend on-chain. The information needed to do this is provided in this enum, including the
/// outpoint describing which txid and output index is available, the full output which exists at
/// that txid/index, and any keys or other information required to sign.
+#[derive(Clone, PartialEq)]
pub enum SpendableOutputDescriptor {
/// An output to a script which was provided via KeysInterface, thus you should already know
/// how to spend it. No keys are provided as rust-lightning was never given any keys - only the
/// The private key which should be used to sign the transaction is provided, as well as the
/// full witness redeemScript which is hashed in the output script_pubkey.
/// The witness in the spending input should be:
- /// <BIP 143 signature generated with the given key> <one zero byte aka OP_0>
+ /// <BIP 143 signature generated with the given key> <empty vector> (MINIMALIF standard rule)
/// <witness_script as provided>
/// Note that the nSequence field in the input must be set to_self_delay (which corresponds to
/// the transaction not being broadcastable until at least to_self_delay blocks after the input
}
}
-impl<R: ::std::io::Read> Readable<R> for SpendableOutputDescriptor {
- fn read(reader: &mut R) -> Result<Self, DecodeError> {
+impl Readable for SpendableOutputDescriptor {
+ fn read<R: ::std::io::Read>(reader: &mut R) -> Result<Self, DecodeError> {
match Readable::read(reader)? {
0u8 => Ok(SpendableOutputDescriptor::StaticOutput {
outpoint: Readable::read(reader)?,
}
}
-impl<R: ::std::io::Read> Readable<R> for InMemoryChannelKeys {
- fn read(reader: &mut R) -> Result<Self, DecodeError> {
+impl Readable for InMemoryChannelKeys {
+ fn read<R: ::std::io::Read>(reader: &mut R) -> Result<Self, DecodeError> {
let funding_key = Readable::read(reader)?;
let revocation_base_key = Readable::read(reader)?;
let payment_base_key = Readable::read(reader)?;