omnilaboratory / obd

OmniBOLT daemon, a golang implementation of OmniBOLT spec, the smart assets lightning network.
MIT License
213 stars 21 forks source link

Alternative construction of HTLC Execution Delivery Transaction #1

Open neocarmack opened 4 years ago

neocarmack commented 4 years ago

image

The transaction in RED box is the HTLC execution delivery transaction, which is locked by custom locking script.

To unlock this transaction, Bob shall provide three arguments: the preimage R, Alice2 and Bob2's signature. And in the process of HTLC, this preimage R is used to exchange money(token) in a channel.

But current Omnicore does not support custom redeem script in locking and unlocking a transaction. So can we just transform this non-standard transaction to a standard 3-3 multisig transaction, replacing R by another private key of an address(public key), which is already well supported by Omnicore.

This transformation is a little bit different from the original process in the white paper. There is no potential risk if we use 3-3 multiSig transaction, because essentially the two solutions are the same: given a number, image or private key, there is no polynomial algorithm to find its preimage or public key.