feat: add ITransactionTransformer for Liquid network support - #892
Open
dangershony wants to merge 1 commit into
Open
feat: add ITransactionTransformer for Liquid network support#892dangershony wants to merge 1 commit into
dangershony wants to merge 1 commit into
Conversation
Add an abstraction layer for network-specific transaction transformations: - ITransactionTransformer: interface for wrapping P2WPKH, Taproot, and P2WSH transactions for the target network - BitcoinTransactionTransformer: no-op implementation for Bitcoin (returns inputs unchanged) - LiquidTransactionTransformer: rebuilds transactions as Elements format with explicit L-BTC asset tags, fee outputs, and re-signs - TransactionInfo: add TransactionHex and TransactionId properties so network-specific representations can be carried alongside the Blockcore Transaction object
Member
Author
Integration assessment ? what's left to make Liquid work end-to-endThis PR adds the cryptographic conversion layer only; nothing calls the transformer yet. Here's an assessment of the remaining work to get Liquid working on mainnet. Already done on
|
| Task | Notes |
|---|---|
| Wire the transformer into ~10 sign/broadcast sites | WalletOperations.cs (4 spots), InvestorTransactionActions.cs, FounderTransactionActions.cs, SeederTransactionActions.cs, SpendingTransactionBuilder.cs, InvestmentTransactionBuilder.cs + per-network DI registration ? largest task |
Broadcast paths must send TransactionInfo.TransactionHex (Elements hex) instead of .ToHex() |
WalletOperations.cs, MempoolSpaceIndexerApi.PublishTransactionAsync |
| Fee logic | Liquid fees ~0.1 sat/vB, fee is an explicit output, Elements txs are larger than the Bitcoin vsize math assumes |
| L-BTC asset filtering in client-side Esplora parsing | Elements vouts carry an asset field; without filtering, any non-L-BTC asset sent to a wallet address would be counted as sats |
| Tests | No transformer or Liquid tests exist yet |
Confidential lq1 addresses / blinded UTXOs |
Out of scope here ? separate, larger phase |
Infrastructure
Since Angor project scanning is now computed client-side against generic Esplora endpoints, no custom indexer is needed ? just:
- An Elements node (mainnet for prod; liquidtestnet or local Elements regtest for dev ? the
docker/boltz/stack already includes Elements regtest) - A stock Esplora-Elements instance at
liquid.angor.online(doubles as the explorer)
Risk concentration
The riskiest part is the Elements taproot sighash logic in this PR ? it needs validation by broadcasting real invest ? recover ? founder-spend ? penalty flows on liquidtestnet before mainnet.
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.
Summary
Adds an abstraction layer for network-specific transaction transformations, enabling Liquid (Elements) network support alongside Bitcoin.
New files
*\ITransactionTransformer* — interface for wrapping P2WPKH, Taproot, and P2WSH transactions for the target network. Also provides \GetSighashTransaction\ / \GetSighashSpentOutputs\ for computing sighashes on the correct network representation.
*\BitcoinTransactionTransformer* — no-op implementation for Bitcoin. All methods return their inputs unchanged.
*\LiquidTransactionTransformer* — Elements implementation that rebuilds transactions with explicit L-BTC asset tags, adds an explicit fee output, and re-signs using the Liquid network parameters.
Modified files