1

We're working on bitcoin SPV wallet. After setting bloom filter, we only get merkle blocks, and transactions that match the hashes we set plus some false positives.

If a transaction is where we SEND coins, we can calculate a fee of that transaction, because we also HAVE previous transaction holding an output we spent.

But, if a transaction is where we RECEIVE coins, then we can't calculate the fee. Because, we DON'T HAVE previous transaction holding someone's output which he spent.

As far as I know, there's no way to request single transaction from peers.

How can we get previous transaction or at least it's output's value?

0

You can't get a previous transaction via the p2p network based on the txid.

If you use BIP37, fees for received transactions are difficult to calculate in a decentralised way.

Have a look at BIP158 which will probably be available on the network soon. It has a feature to find the block of your previous txout as well as it doesn't have the privacy problem of BIP37.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.