Skip to content

Patronum: Ethereum RPC proxy that verifies RPC responses against given trusted block hashes

Notifications You must be signed in to change notification settings

commonprefix/patronum

Repository files navigation

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 = 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.

About

Patronum: Ethereum RPC proxy that verifies RPC responses against given trusted block hashes

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages