Proposing New Function to Select Transactions


Select all blockchain transactions in block/index order based on a set of criteria. This is similar in concept to filtering events from a smart contract’s log.

Current Approach

Fetch each block and the full transaction data. Iterate and apply the filter on the client side. Each such fetch causes an ipc message exchange (node -> geth -> node) and may send more data than is needed.


For efficiency, the web3 service providers (geth, parity, infura etc) should implement a server-side transaction query function callable via web3 api.

Example (running in node.js with web3 module)

let txfilter = { from: addressa, to: addressb };
let colfilter = [ 'input', 'hash' ];

web3.eth.getTransactions( 0, 'latest', txfilter, colfilter )
.then( (txlist) => {

for (let ii = 0; ii < txlist.length; ii++) {
let tx = txlist[ii].hash;
let hexdata = txlists[ii].input; // .from and .to fields not present

} )