Closed monsterbitar closed 10 months ago
Yes this is not difficult at all to implement since it re-uses existing database data easily enough with zero extra cost. I’ll try and get this in before the next release.
this would be useful
Ok I implemented this in PR #210 . Note that I am copying the API of the Electrs & Rostrum implementation. Of note:
null
result here (but then we would be breaking from Rostrum).token_filter
here in Fulcrum. This is because Fulcrum doesn't store token history (only token utxos). So the API for this in Fulcrum is like the old pre-token Electrs API.I am in particular curious about the first bullet-point above. Do we want to return null
if the address has no history or do we want to throw an RPC error. I am a bit uncomfortable with throwing an error here because the other blockchain.address.*
RPCs only throw on invalid arguments, never on missing history or missing utxos for a particular address.
I commented on the MR with a preference for null instead of error, as I have what I consider valid usage that will not find data (recover from seed without knowing the derivation path, therefor trying multiple paths).
Closing this issue since the feature is implemented, but ideally some coordination with other implementations on the matter would be helpful. if they are willing to update they can, for example, make it so that after some specific version it adops the new behaviour. If not, then it's probably better to stick with the error version for now.
TBH for the reasons you cited -- it makes more sense to return null
here. I will change it and notify in this issue when that's done.
Actually. I just re-read what you wrote. It seems you want to co-ordinate with Rostrum (the only other impl.). Can you ask @dagurval if he is willing to change it?
If so then I will change it. He may listen to you. :)
Update: After discussions on TG it appears people are ok with returning null
for unused addresses. I have updated Fulcrum to do just that in the latest commit pushed to master.
There is a proposal for blockchain.address.get_first_use and blockchain.scripthash.get_first_use on https://bitcoincash.network/electrum/protocol-methods-extra.html#blockchain-address-get-first-use which seems useful.