Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor output support in Elements mode #7794

Open
philipr-za opened this issue Nov 5, 2024 · 0 comments
Open

Anchor output support in Elements mode #7794

philipr-za opened this issue Nov 5, 2024 · 0 comments

Comments

@philipr-za
Copy link

Issue and Steps to Reproduce

Unfortunately the issue is not easy to reproduce but I will describe it as well as I can:

I am working on adding Elements/Liquid support to the VLS signer. VLS has an integration test repo here where they test their signer replacing the HSM of CLN.

In my testing of my Elements support in VLS I ran into the following problem:

With the tests/test_pay.py::test_pay pyln test when running the CLN-VLS integration test environment under the liquid-regtest network VLS is failing when handling the SignRemoteCommitmentTx operation because the Elements flavoured PSBT (strictly speaking a PSET using the PSBTv2 format) is received as part of that requrest the outputs do not have the required witness_scripts. It looks like they are plain P2WSH outputs rather than Segwit outputs with an Anchor output script. VLS asserts that every output should have a witness script and so crashed.

In CLN I tracked the issue to the following spot:
This transaction and PSBT is constructed in CLN in the struct bitcoin_tx *initial_commit_tx(...) method which is being called from openingd.c::funder_finalize_channel_setup(...)

So when that method comes to adding outputs both regtest and liquid-regtest cases don't add a to_local output.

They both add a to_remote outputs BUT in the regtest mode the option_anchors_zero_fee_htlc_tx flag is set so the witness script is added to the output. In the liquid-regtest mode that flag is NOT set and so the witness script is not added.
finally in regtest mode the option_anchors_zero_fee_htlc_tx flag being set means that an anchor_output is added to the transaction but it is not included liquid-regtest mode.

getinfo output

The VLS integration test environment is using this branch of CLN
https://github.com/lightning-signer/c-lightning/tree/2024-05-remote-hsmd-cln-v24.05

Received response for getinfo call: {'jsonrpc': '2.0', 'id': 'pytest:getinfo#2', 'result': {'id': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518', 'alias': 'JUNIORBEAM-smd-cln-v24.05-modded', 'color': '0266e4', 'num_peers': 0, 'num_pending_channels': 0, 'num_active_channels': 0, 'num_inactive_channels': 0, 'address': [], 'binding': [{'type': 'ipv4', 'address': '127.0.0.1', 'port': 45621}], 'version': 'remote-hsmd-cln-v24.05-modded', 'blockheight': 101, 'network': 'regtest', 'fees_collected_msat': 0, 'lightning-dir': '/root/vls-hsmd/TEST-20241105-135945/ltests-eesvjwt2/test_pay_1/lightning-1/regtest', 'our_features': {'init': '08a0000a8a59a1', 'node': '88a0000a8a59a1', 'channel': '', 'invoice': '02000002024100'}}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant