0xMiden / 0xMiden/protocol

AggLayer: onchain verification of metadata hash during faucet registration

Ouverte
#2,586 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
agglayer
Langage dominant
Rust
Étoiles
132
Forks
167
Merge moyen
1 j 22 h
PR mergées (30 j)
116

Description

During faucet registration (`register_faucet` in `bridge_config.masm`), the bridge should verify that the faucet's stored `metadata_hash` matches `keccak256(abi.encode(name, symbol, decimals))` computed from the faucet's actual storage values.

Currently the metadata hash is trusted from the faucet deployer with no on-chain verification. A malicious or misconfigured deployer could set an incorrect hash, causing bridge-out claims to fail on the EVM side.

Prerequisites:
- #2585 (token name in faucet storage)
- Implement `abi.encode(string, string, uint8)` in MASM

The verification would:
1. FPI to the faucet to read name, symbol, decimals
2. ABI-encode them in MASM
3. Keccak256 the encoded bytes
4. FPI to the faucet to read the stored metadata hash
5. Assert they match

There is a TODO in `bridge_config.masm::register_faucet` tracking as of PR #2583

Related: #2453

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

The work is in `bridge_config.masm` in the `register_faucet` function, where a TODO exists. First, understand the MASM language and the FPI (Foreign Procedure Interface) mechanism. Review prerequisite issue #2585 for token name storage. Implement ABI encoding for (string, string, uint8) in MASM, then compute keccak256 and compare with the stored metadata hash. Testing will involve deploying a faucet and verifying the on-chain check.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
rust, solidity
Domaine
backend, blockchain
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.