Making MetaMask and TronLink sign transactions for a custom Rust blockchain
Описание и применение
Блокчейн Clutch, написанный на Rust, интегрировал стандартные кошельки MetaMask и TronLink, реализовав три схемы подписи и тип WalletTransfer для отправки токенов CLT. Были устранены критические ошибки, связанные с deferred‑batch записью, комиссией майнера и режимом разработчика, что обеспечило безопасную работу с реальными USDT.
Задача
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.
Результат
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.
Рабочий процесс
- 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.
Доказательства
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.
The node decodes the raw Ethereum transaction and recovers from from its signature.
Three bugs that could have created money…
- Дата записи: 2026-11-02T06:28:57.941Z