Whatโ€™s LNhance?

Reply to this note

Please Login to reply.

Discussion

OP_CTV + OP_CHECKSIGFROMSTACK + OP_INTERNALKEY

A very productive, probably safe improvement that allows lightning symmetry and all sorts of other great things (mostly coming from OP_CTV alone)

OP_CHECKSIGFROMSTACK is the only potentially dangerous opcode in that, CTV and INTERNALKEY are both very, very safe.

Whatโ€™s OP_INTERNALKEY? Never heard of it. ๐Ÿคทโ€โ™€๏ธ

If you're familiar with taproot, a taproot output is

tweak(internal_pubkey, fancy_hash(taptree)) (the result of this is also a pubkey)

When you spend with the taptree (script path) your witness (spending info) includes that `internal_pubkey` which takes up 32 bytes. It's a very important part of validating a script spend, but it's also kind of 32 wasted bytes.

OP_INTERNALKEY just pushes those 32 bytes of pubkey onto the stack so you can use it in your script. (32:1 compression ratio for a public key used in your scripts!)

It's not always usable, but it often is, nice, significant space savings.