Covenants integration infrastructure#44
Conversation
Covenant UTXO + Wallet UTXO Spending in lwk_webProblemFor covenant spending we need a transaction that contains both:
Current new TxBuilder(network)
.setWalletUtxos(...)
.addExplicitRecipient(...)
.finish(wollet)The important detail is that If a mixed transaction is assembled manually, covenant inputs can be added, but wallet inputs may miss metadata expected by LWK signers and Jade. InvestigationCore support already exists in LWK. Core implementationThe core add_external_utxos(...)and self.external_utxosby adding them through: add_external_input(...)This means the core builder already supports: WASM bindingsThe investigation suggests that the core functionality is already implemented. The only missing piece appears to be a WASM binding that exposes The missing API is effectively: #[wasm_bindgen]
pub fn add_external_utxos(...)on the wasm Proposed APInew TxBuilder(network)
.feeRate(100)
.setWalletUtxos([walletInput])
.addExternalUtxos([covenantInput])
.addExplicitRecipient(receiver, amount, policyAsset)
.finish(wollet)Result:
Why v1 Is Differentv1 uses manual signing: v2 uses signer-based flows: These signers must be able to recognize wallet-owned inputs and their derivation metadata. While covenant inputs can be added manually, wallet inputs assembled outside the standard LWK transaction builder may not contain the metadata required by LWK/Jade signers. Therefore the v1 approach does not directly solve the v2 production flow. |
No description provided.