Author

Topic: Optimized Bitcoin HTLC BIP (Read 168 times)

legendary
Activity: 4270
Merit: 4534
November 20, 2018, 11:08:27 AM
#2
keeping the extra byte is something core devs love as they can use that byte to add more opcodes. and also do some inflight forks/upgrades without disturbing older nodes

EG ELI-15 (very dumbed down example for general readers, dont knick pick length of position of bytes.. its just for display)
the old opcode

imagine a tx xxxxxxxxxxx~xxxxxxxxxxxxxxxxxxx
imagine ~ was an opcode byte
they can at one point has just

(numbers in ascii upto 256)
~ is:
0=no action pass as acceptable without checking (anyone can spend)
1=do a
2=do b
.. and so on

they can the change it, so that if 0(ascii) selected that it now treats for new segwit nodes that 'do nothing'(anyonecanspend) is now 'follow segwit opcode list'
where segwit can then totally change what comes after ~
xxxxxxxxxxx~%xxxxxxxxxxxxxxxxxxx

so then they can have a sub-list of opcodes(%) and different things. without having to change the original ~
then have the % have another sub opcode list

thus expanding and adding new opcodes without forcing nodes that only understand the original ~ or % as a short list
EG
0(~)=segwit
     00(~%)=segwit do nothing
     01(~%)=segwit do z
     02(~%)=segwit do x
1(~)=do a
2(~)=do b
newbie
Activity: 7
Merit: 3
November 20, 2018, 10:25:49 AM
#1
Recently added a PR to Bitcoin BIPs Repo. This is an optimized HTLC using the same inputs, but saves 1 byte of data for each P2SH.

https://github.com/bitcoin/bips/pull/738

Looking for community feedback on this.
Jump to: