@lightclients/patronum
v0.3.2
Published
Patronum: Ethereum RPC proxy that verifies RPC responses against given trusted block hashes
Downloads
178
Readme
Patronum
Ethereum RPC proxy that verifies RPC responses against given trusted block hashes. Currently, most of the DAPPs and Wallets interact with Ethereum over RPC. Patronum can be used as a building block to build light clients that retrofit into the existing Ethereum infrastructure. This library mainly takes advantage of the eth_getProof
RPC to perform merkle inclusion proofs for RPC call verification.
Start RPC Provider
import { VerifyingProvider, startServer } from 'patronum';
const provider = await VerifyingProvider.create(
trustlessRPCURL,
trustedBlockNumber,
trustedBlockHash,
);
await startServer(provider, PORT);
Use VerifyingProvider
import { VerifyingProvider } from 'patronum';
const provider = await VerifyingProvider.create(
trustlessRPCURL,
trustedBlockNumber,
trustedBlockHash,
);
console.log(await provider.getBalance(address, blockTag));
console.log(await provider.call(tx));
The RPC URL provided to VerifyingProvider should support eth_getProof
and eth_createAccessList
. Infura doesn't support eth_createAccessList
.