Alex Bosworth [ARCHIVE] on Nostr: 📅 Original date posted:2018-09-04 📝 Original message:I've been experimenting ...
📅 Original date posted:2018-09-04
📝 Original message:I've been experimenting with a format tag for BIP 174 to help support
HTLC scripts I've been working with.
Not sure on the best format for this, but what I have been thinking
about is a new input type that defines elements that should be
inserted in the final p2sh/p2wsh stack such as a preimage or a refund
path flag.
Type: Additional Stack Element ADDITIONAL_STACK_ELEMENT = 0xXX
Key: The index in the stack to insert a value (uint32 LE)
{0xXX}|{Stack index}
Value: The value to push into the stack for a redeem script or witness
script at the specified index.
{value}
So my flow is:
1. Create blank PSBT (attaching locktime, anticipating final weight to
adjust outputs for fees)
2. Update with redeem scripts and/or witness scripts
3. Update with sighashes
4. Sign: generate partial signature
5. Attach additional stack elements for the required non-signature elements
6. Finalize to create the final scriptsig and/or witness
7. Extract the signed transaction for broadcast
This may be overkill or overly generic, has anyone else thought of how
to use PSBTs in an HTLC context?
--
Sent from my iPhone
Published at
2023-06-07 18:14:36Event JSON
{
"id": "13ed625a040f0f8f952cc18517eecb0c9d1fb7995c1042ae49dc0574bc767c66",
"pubkey": "2f27cef85c402f6e9be0d9a64ba9fd8cecf414cca567f1f529cc4f1494f97b5f",
"created_at": 1686161676,
"kind": 1,
"tags": [
[
"e",
"3546f932e146ed2c7028401c3985d0138fbcb0985d318542a98688c4b565d463",
"",
"reply"
],
[
"p",
"a23dbf6c6cc83e14cc3df4e56cc71845f611908084cfe620e83e40c06ccdd3d0"
]
],
"content": "📅 Original date posted:2018-09-04\n📝 Original message:I've been experimenting with a format tag for BIP 174 to help support\nHTLC scripts I've been working with.\n\nNot sure on the best format for this, but what I have been thinking\nabout is a new input type that defines elements that should be\ninserted in the final p2sh/p2wsh stack such as a preimage or a refund\npath flag.\n\nType: Additional Stack Element ADDITIONAL_STACK_ELEMENT = 0xXX\n\nKey: The index in the stack to insert a value (uint32 LE)\n\n{0xXX}|{Stack index}\n\nValue: The value to push into the stack for a redeem script or witness\nscript at the specified index.\n\n{value}\n\nSo my flow is:\n\n1. Create blank PSBT (attaching locktime, anticipating final weight to\nadjust outputs for fees)\n2. Update with redeem scripts and/or witness scripts\n3. Update with sighashes\n4. Sign: generate partial signature\n5. Attach additional stack elements for the required non-signature elements\n6. Finalize to create the final scriptsig and/or witness\n7. Extract the signed transaction for broadcast\n\nThis may be overkill or overly generic, has anyone else thought of how\nto use PSBTs in an HTLC context?\n\n-- \nSent from my iPhone",
"sig": "1918027cb147120bdc09eaae783777213cfdbea561e5ce8d0172a4c54fff31799540ae26d1bf67f31f932e5fcccc118f76763acb9b9d95ac0b45f78d89c98c94"
}