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
Address
mev-commit chain mainnet
mev-commit chain testnet
How to query the registry for registered providers
You can retrieve all registered 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.mev-commit.xyz/");// Define the contract address and ABIconst providerRegistryAddress = "0xb772Add4718E5BD6Fe57Fb486A6f7f008E52167E";const abi = [ "event ProviderRegistered(address indexed provider, uint256 stakedAmount)", "function isProviderValid(address provider) public view", "function getBLSKeys(address provider) external view returns (bytes[])"];// Create a new contract instanceconst contract = new ethers.Contract(providerRegistryAddress, abi, provider);// Function to retrieve BLS keys grouped by valid provider addressasync function getRegisteredProviders() { const filter = contract.filters.ProviderRegistered(); const events = await contract.queryFilter(filter); let totalKeys = 0; const providerMap = {}; for (const event of events) { const providerAddress = event.args.provider; try { //This will fail if the provider isn't valid await contract.isProviderValid(providerAddress); const blsKeys = await contract.getBLSKeys(providerAddress); // Convert each key to hex string for any future usage providerMap[providerAddress] = blsKeys.map(key => ethers.hexlify(key)); totalKeys += blsKeys.length } catch (error) { // Skip invalid providers or failed fetches } } console.log("Total registered keys: ", totalKeys); return providerMap;}// Run and log providers with their BLS keysgetRegisteredProviders() .then(providerMap => { console.log("Valid providers and their BLS keys:"); for (const [address, blsKeys] of Object.entries(providerMap)) { console.log(`\nProvider: ${address}`); blsKeys.forEach((key, index) => { console.log(` Key ${index + 1}: ${key}`); }); } }) .catch(error => { console.error("Error fetching providers:", error); });
Expected Output
The output will contain the number of all registered keys and a list of providers with their registered BLS public keys.
Copy
Ask AI
Total registered keys: 23Valid providers and their BLS keys:Provider: 0x... Key 1: 0x...Provider: 0x... Key 1: 0x...Provider: 0x... Key 1: 0x... Key 2: 0x... Key 3: 0x......