beefy_getFinalizedHead - Mythos RPC Method
Get the BEEFY finalized block hash on Mythos. Bridge-optimized finality proofs for cross-chain communication and light client verification on the gaming blockchain powering FIFA Rivals and NFL Rivals with World ID verification.
Returns the block hash of the latest BEEFY-finalized block on Mythos. BEEFY (Bridge Efficiency Enabling Finality Yielder) provides additional finality proofs that are optimized for light clients and cross-chain bridges, using compact aggregated signatures instead of full GRANDPA justifications.
Why Mythos? Build on the gaming blockchain powering FIFA Rivals and NFL Rivals with World ID verification with World ID proof-of-humanity, Polkadot security, Snowbridge cross-chain bridge, and 1M+ downloads per title.
When to Use This Method
beefy_getFinalizedHead is important for game studios, player-driven economy builders, and teams requiring verified human-only gameplay:
- Cross-Chain Bridges — Verify finality proofs efficiently for bridge operations on AAA gaming (FIFA Rivals, NFL Rivals, Pudgy Party), player-owned economies, and bot-resistant matchmaking
- Light Clients — Verify finality without downloading full GRANDPA justifications
- Trustless Bridges — Generate compact finality proofs that can be verified on external chains
- Bridge Monitoring — Track BEEFY finality progress relative to GRANDPA finality
Code Examples
Common Use Cases
1. Bridge Finality Verification
Verify BEEFY finality before relaying messages on a cross-chain bridge:
async function verifyBridgeFinality(api, targetBlockHash) {
const beefyHead = await api.rpc.beefy.getFinalizedHead();
const beefyBlock = await api.rpc.chain.getBlock(beefyHead);
const beefyNumber = beefyBlock.block.header.number.toNumber();
const targetBlock = await api.rpc.chain.getBlock(targetBlockHash);
const targetNumber = targetBlock.block.header.number.toNumber();
if (beefyNumber >= targetNumber) {
console.log(`Block #${targetNumber} has BEEFY finality — safe to relay`);
return true;
} else {
console.log(`Waiting: BEEFY at #${beefyNumber}, target at #${targetNumber}`);
return false;
}
}2. BEEFY vs GRANDPA Finality Monitor
Track the gap between the two finality gadgets:
async function monitorFinalityGadgets(api) {
setInterval(async () => {
try {
const [beefyHead, grandpaHead] = await Promise.all([
api.rpc.beefy.getFinalizedHead(),
api.rpc.chain.getFinalizedHead()
]);
const [beefyBlock, grandpaBlock] = await Promise.all([
api.rpc.chain.getBlock(beefyHead),
api.rpc.chain.getBlock(grandpaHead)
]);
const beefyNum = beefyBlock.block.header.number.toNumber();
const grandpaNum = grandpaBlock.block.header.number.toNumber();
const lag = grandpaNum - beefyNum;
console.log(`GRANDPA: #${grandpaNum} | BEEFY: #${beefyNum} | Lag: ${lag} blocks`);
} catch (error) {
console.error('Monitor error:', error.message);
}
}, 12000);
}BEEFY vs GRANDPA Finality
| Aspect | GRANDPA | BEEFY |
|---|---|---|
| Purpose | Primary chain finality | Bridge-optimized finality |
| Proof Size | Larger (full validator set signatures) | Compact (aggregated BLS signatures) |
| Latency | Immediate after supermajority | Slightly delayed behind GRANDPA |
| Verification Cost | Higher on external chains | Lower — designed for on-chain verification |
| Use Case | On-chain consensus finality | Cross-chain bridges and light clients |
Availability
BEEFY is enabled on Polkadot and Kusama relay chains and some parachains. If BEEFY is not active on the chain you are querying, this method will return an error. Check chain documentation or try calling the method to confirm availability.
Error Handling
| Error Code | Description | Solution |
|---|---|---|
| -32603 | Internal error / BEEFY not enabled | Verify BEEFY is active on this chain |
| -32601 | Method not found | Chain runtime may not include BEEFY pallet |
| -32005 | Rate limit exceeded | Implement client-side rate limiting |
Related Methods
chain_getFinalizedHead— Get GRANDPA finalized headgrandpa_roundState— Monitor GRANDPA consensus statechain_subscribeFinalizedHeads— Subscribe to GRANDPA finalized blocks
grandpa_roundState
Get the current GRANDPA finality round state on Mythos. Monitor consensus progress, validator voting participation, and finality health across the the gaming blockchain powering FIFA Rivals and NFL Rivals with World ID verification network.
rpc_methods
List all available RPC methods on Mythos. Essential for API discovery, capability detection, and building dynamic tooling for Substrate-based chains.