Blockstream / esplora

Explorer for Bitcoin and Liquid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

electrum: blockchain.scripthash.get_balance does not work for Liquid

tiero opened this issue · comments

I am testing the Electrum websocket interface of Esplora, the method blockchain.scripthash.get_balance it seems to not work

blockchain.scripthash.listunspent works just fine for example, I guess get_balance can't be implemented due the confidential txs? In my test, I am using a scripthash that has non-confidential utxos on it.

Hi tiero!

This was discussed back when Liquid support was implemented, and it was decided that its better to exclude balance information entirely than to provide incomplete information for non-CT outputs only. This is true for both the Electrum RPC and the HTTP API (namely, the {funded,spent}_txo_sum stat fields are unavailable).

This decision can be revisited if this is deemed useful, changing the code to track amounts for non-CT outputs is pretty straightforward. Can you tell me more about your use-case?

/cc @greenaddress

@shesek I think that makes sense the decision and would be fair to NOT have it.

I was testing one-one methods from ElectrumX documentation and trying to see what is working or not on Liquid. Maybe having a documentation of the RPCs available (like the REST APIs) and the different signature req/res from Bitcoin's ElectrumX would be helpful/

For example was not obvious that listunspent returns ONLY the value (but not the asset), and is actually a tuple with prefix & LE value/commitment. #419

Maybe having a documentation of the RPCs available and the different signature req/res from Bitcoin's ElectrumX would be helpful

Right now, the only differences in the RPC API that I'm aware of are that get_balance is unavailable, the extra fields on listunspent (added in Blockstream/electrs#51 in reply to #419, still not on master) and the different serialization format for amounts. It would be good to document that somewhere with more visibility.