feat: Add single funded DLC support to messaging#224
Merged
Conversation
0238737 to
8c6156f
Compare
- add singleFunded flag and methods to DlcOffer and DlcAccept - implement auto-detection logic for single funded DLCs - update validation rules for single funded DLC scenarios - add comprehensive test coverage for new functionality In single funded DLCs: - DlcOffer: totalCollateral equals offerCollateral - DlcAccept: acceptCollateral is typically 0 or minimal
8c6156f to
abe0728
Compare
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.
What
This PR adds comprehensive support for single funded DLCs to the messaging layer, allowing for DLC contracts where only one party provides collateral.
Changes Made
Core Changes
singleFundedflag and related methods (markAsSingleFunded(),isSingleFunded())singleFundedflag and related methods for acceptor sideSingle Funded DLC Characteristics
totalCollateralequalsofferCollateral(offerer funds the entire contract)acceptCollateralis typically 0 or minimal (acceptor provides little/no collateral)Test Coverage
DlcOfferandDlcAcceptsingle funded functionalityBackward Compatibility
Usage Example
This implementation enables more flexible DLC contract arrangements where one party can fund the entire contract