@lightclients/patronum
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

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.

Patronus

Start RPC Provider

import { VerifyingProvider, startServer } from 'patronum';

const provider = new VerifyingProvider(
  trustlessRPCURL,
  trustedBlockNumber,
  trustedBlockHash,
);
await startServer(provider, PORT);

Use VerifyingProvider

import { VerifyingProvider } from 'patronum';

const provider = new VerifyingProvider(
  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.

/@lightclients/patronum/

    Package Sidebar

    Install

    npm i @lightclients/patronum

    Weekly Downloads

    3

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    219 kB

    Total Files

    67

    Last publish

    Collaborators

    • shresthagrawal