What is Nostr?
Ademan /
npub19je…pt7r
2024-02-01 19:51:24
in reply to nevent1q…dvw7

Ademan on Nostr: Where can I find template key? The RBF discussion on twitter the other day caused me ...

Where can I find template key? The RBF discussion on twitter the other day caused me to consider some CTV upgrade ideas. I wonder how similar (or not) they are.

It would use the same template as the default CTV template up until the number of outputs, and there it would behave the same as CTV but with the list of outputs truncated to the first N_OUTPUTS.

witness: <sigA> <TEMPLATE_HASH || 0x01 || N_OUTPUTS as VarInt>

program: OP_CHECKTEMPLATEVERIFY OP_DROP(?) <pkA> OP_CHECKSIGVERIFY

This should enable a RBF-able CTV that lets you RBF by reducing the output amounts from N_OUTPUTS to the end of the output list, it even lets you prune outputs if you want.

From further discussion I realized that the ability to add an *INPUT* is important too for ln-symmetry, since modifying the output amount (not the TXID in this case, afaik) will hamper later updates, so the template should probably should be <TEMPLATE_HASH || 0x01 || N_INPUTS as VarInt || N_OUTPUTS as VarInt>
Author Public Key
npub19jescdjr3wk552j3q77f3awwhe4qy2ds24xce773exd28nr7emqsm2pt7r