I am posting here, because as I developped TumbleBit, it turned out that Core has been built on the assumption that you should never need to know the “from address” of a transaction.
This is definitively true for Bitcoin Layer 1. However, for Layer 2 protocol, this is not the case. (This is actually similar case as the one discussed on #10007 for the UI layer)
I’d like to know what you think about having a listsentbyaddress
in Bitcoin Core, and here is why I would need it.
In TumbleBit there is a chain of transaction
0[Escrow] -> [Offer] -> [Fulfill]
Escrow is confirmed. The user is interested into the [Fulfill] transaction, which reveal some important hash preimage. The user knows one scriptPubKey of Offer Transaction, but does not know its transaction ID. [Fulfill] is spending this scriptPubKey.
If listsentbyaddress
existed, then the user would be able to query offer’s scriptPubKey, and retrieve [Fulfill].
Without this feature, my only workaround is to cache all wallet transactions in an internal database unrelated to Bitcoin Core, then derive the scriptPubKey from the input of those transactions, and see if it match Offer’s scriptPubKey.