有没有办法手动实现HTLC,用于锁定闪电网络通道中的资金,并在时间锁定到期后释放资金。
发布于 2019-05-07 18:59:37
在https://bitcoin.stackexchange.com上问这个问题可能更好,但是,如果您查看BOLT 03 transactions上的lightning network规范(也称为BOLT),您会发现以下脚本用于提交事务
# To remote node with revocation key
OP_DUP OP_HASH160 <RIPEMD160(SHA256(revocationpubkey))> OP_EQUAL
OP_IF
OP_CHECKSIG
OP_ELSE
<remote_htlcpubkey> OP_SWAP OP_SIZE 32 OP_EQUAL
OP_NOTIF
# To local node via HTLC-timeout transaction (timelocked).
OP_DROP 2 OP_SWAP <local_htlcpubkey> 2 OP_CHECKMULTISIG
OP_ELSE
# To remote node with preimage.
OP_HASH160 <RIPEMD160(payment_hash)> OP_EQUALVERIFY
OP_CHECKSIG
OP_ENDIF
OP_ENDIF还要注意的是,这里有一个standalone BIP 199 which is still a draft but specifies how to work with htlcs。
https://stackoverflow.com/questions/56020338
复制相似问题