Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Making MetaMask and TronLink sign transactions for a custom Rust blockchain

Description and use

Clutch, a Rust‑based blockchain, integrated MetaMask and TronLink wallets by implementing three signature schemes and a WalletTransfer type for CLT transfers. Critical bugs around deferred writes, miner fees, and developer mode were fixed, enabling secure handling of real USDT.

Problem

Wallets refuse to sign a bare hash for a custom chain, and the node must accept signatures from MetaMask, Trust Wallet, and TronLink while preventing replay attacks and ensuring correct token handling.

Outcome

The blockchain now accepts standard wallet signatures, allows MetaMask to send CLT, and securely backs CLT with USDT. Three critical bugs were identified and fixed, preventing potential money creation or loss.

Workflow

  • 1. Define three signature schemes and their digests. 2. Update node to accept SDK, MetaMask/Trust Wallet, and TronLink signatures. 3. Add WalletTransfer transaction type for MetaMask legacy send. 4. Enforce value conversion (CLT units ×10^12) and reject values with >6 decimals. 5. Implement consensus‑controlled activation via wallet_chain_id and wallet_transfers_from_block. 6. Deploy mainnet with real USDT backing and mint/burn logic. 7. Fix three critical bugs related to deferred writes, block author fee, and developer_mode database deletion. 8. Release testnet for user testing and feedback.

Evidence

A wallet will not sign 32 opaque bytes for you, and it is right not to: a bare hash could be an Ethereum transaction on another chain.

Source

The node decodes the raw Ethereum transaction and recovers from from its signature.

Source

Three bugs that could have created money…

Source

  • Record date: 2026-11-02T06:28:57.941Z