The mev-commit provider registry contract maintains the list of authorized providers such as block builders. You can query this contract to validate builder addresses.Contract Details:
Network: mev-commit-chain
Address:
How to query the registry for connected providers
You can retrieve all connected providers using the following script:
Copy
Ask AI
// Import the ethers libraryconst ethers = require("ethers");// Define the provider using the RPC URLconst provider = new ethers.JsonRpcProvider("https://chainrpc.testnet.mev-commit.xyz/");// Define the contract address and ABIconst providerRegistryAddress = "0x1C2a592950E5dAd49c0E2F3A402DCF496bdf7b67";const abi = [ "event ProviderRegistered(address indexed provider, uint256 stakedAmount, bytes blsPublicKey)"];// Create a new contract instanceconst contract = new ethers.Contract(providerRegistryAddress, abi, provider);// Function to retrieve the list of registered providersasync function getRegisteredProviders() { // Create a filter for the ProviderRegistered event const filter = contract.filters.ProviderRegistered(); // Query the contract for the ProviderRegistered events const events = await contract.queryFilter(filter); // Map the events to get the list of provider bls public keys const providers = events.map(event => event.args.blsPublicKey); return providers;}// Call the function and log the resultgetRegisteredProviders().then(providers => { console.log("Registered Providers:", providers);}).catch(error => { console.error("Error:", error);});
Expected Output
The output will be a list of providers, identified by their BLS pubkey, that have registered with mev-commit.