js-tendermint icon indicating copy to clipboard operation
js-tendermint copied to clipboard

Verify tx inclusion proofs

Open keppel opened this issue 7 years ago • 1 comments

Tendermint RPC has a /tx?hash=_&prove=_ endpoint which returns a proof that the transaction with the given hash made it into a block.

It would be nice if the LightNode class had a method to retrieve and verify these proofs.

Perhaps something like:

let tendermint = require('tendermint')
let lightClient = tendermint(nodeAddress, initialClientState)

let txIncluded = await lightClient.verifyTxInclusion(txHash) // `true` or `false`

keppel avatar Jul 19 '18 16:07 keppel

Good idea, I think this concept makes sense. Is the use case for clients broadcasting transactions and checking to ensure it was included in a block?

Probably makes sense to include the relevant information about the transaction (height, result, etc.) since we're fetching it anyway.

mappum avatar Jul 27 '18 21:07 mappum