Repository navigation
messaging: add the PayoutScriptOverrides TLV on DlcOffer - #242
Open
matthewjablack wants to merge 1 commit into
Open
matthewjablack wants to merge 1 commit into
matthewjablack wants to merge 1 commit into
Conversation
Names the enum outcomes whose CET pays a script other than the offerer's, so a liquidated-by-<address> outcome can pay the liquidator's Bitcoin address. Type 65005, same wire format as the ddk-messages record, with the bytes pinned in a test on both sides. The offer reads it back as a typed field instead of an unknown TLV, writes it in the TLV stream, and includes it in toJSON's tlvs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
PayoutScriptOverridesTLV onDlcOffer, type 65005. It names the enum outcomes whose CET pays a script other than the accepter's, so aliquidated-by-0x…outcome can pay the liquidator's Bitcoin address. Amounts stay in the descriptor, only the accepter's output script is swapped. The accepter is the lender in a loan, and a liquidator is paid in the lender's place.The offer reads it back as a typed
payoutScriptOverridesfield instead of an unknown TLV, writes it in the TLV stream, and includes it intoJSON's tlvs. Wire format is the same as the ddk-messages record: BigSize count, then per entry a BigSize prefixed UTF-8 outcome and a u16 prefixed script. The bytes are pinned in a test here and in dlcdevkit so either encoder drifting fails there rather than at signature verification.node-dlc only builds the funding transaction, so the CET rewrite lives in BAL (AtomicFinance/bitcoin-abstraction-layer#218) and in dlcdevkit (bennyhodl/dlcdevkit#222). I left
fromJSONalone since the JSON path drops every TLV today.Messaging tests, lint, and build pass.