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

liquid: elementsd burn outputs are shown as Unknown address #122

Closed
LeoComandini opened this issue Mar 26, 2024 · 4 comments
Closed

liquid: elementsd burn outputs are shown as Unknown address #122

LeoComandini opened this issue Mar 26, 2024 · 4 comments

Comments

@LeoComandini
Copy link
Contributor

Elements Core creates burn outputs with a single OP_RETURN [1]

            } else if (name_ == "burn") {
                CScript datascript = CScript() << OP_RETURN;
                CAmount nAmount = AmountFromValue(output[name_]);
                out.nValue = nAmount;
                out.scriptPubKey = datascript;

Jade uses wally_scriptpubkey_get_type to recognize and render OP_RETURN and burn outputs. [2][3]

However wally_scriptpubkey_get_type considers a single OP_RETURN as an unknown script type

>>> assert wally.scriptpubkey_get_type(b"\x6a\x00") == wally.WALLY_SCRIPT_TYPE_OP_RETURN
>>> assert wally.scriptpubkey_get_type(b"\x6a") == wally.WALLY_SCRIPT_TYPE_UNKNOWN

Thus burn outputs consisting in <OP_RETURN> only are shown as "To: Unknown address".

Should we change jade code to render such burn outputs with "To: Burning Asset - ..."?
Or should we change wally to have assert wally.scriptpubkey_get_type(b"\x6a") == wally.WALLY_SCRIPT_TYPE_OP_RETURN?


[1] https://github.com/ElementsProject/elements/blob/master/src/rpc/rawtransaction_util.cpp#L328-L332
[2] https://github.com/Blockstream/Jade/blob/master/main/utils/address.c#L125
[3] https://github.com/Blockstream/Jade/blob/master/main/utils/address.c#L150

@LeoComandini LeoComandini changed the title liquid: elementsd burn output are shown as Unknown address liquid: elementsd burn outputs are shown as Unknown address Mar 26, 2024
@JamieDriver
Copy link
Collaborator

I believe Jade should render elements OP_RETURNs that have a sats amount as a burn, as you suggest - but yes, agree it relies on wally.scriptpubkey_get_type() identifying the output/script as an OP_RETURN.

@LeoComandini
Copy link
Contributor Author

Change on the wally side ElementsProject/libwally-core#448

@JamieDriver
Copy link
Collaborator

Jade fw 1.0.31 includes wally version 1.3.0, which I believe includes your changes in this area - so should now be fixed. 👍

@JamieDriver
Copy link
Collaborator

Presuming resolved.

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

2 participants