Detect malicious transactions before they happen. Transformer based malicious contract detection from opcodes. Trained on 100k+ smart contracts. 99%+ accuracy. Integrated into MetaMask snap + simulates transactions for 100% peace of mind.
Getting hacked sucks! But this happens all too often in web3. We prevent this at transaction time using cutting edge transformer language models.
Using a transformer based model trained on 100k+ Solidity contracts, we classify malicious smart contracts with 99%+ accuracy. Best of all, this is all integrated right into MetaMask as a snap. Anytime you make a transaction, simply click on our snap tab and see an instant determination of the safety of your target contract.
For malicious contracts, we offer built in transaction simulation for ultimate peace of mind. Our models beat industry comparisons by over 30%, but they aren't perfect. Our transaction simulation provides 100% verification about asset changes on top of our model's classification.
We'll break this down into 3 parts: Our transformer, our front-end, and our transaction simulation.
For our transformer model, we first scrapped the web for 100k+ smart contracts from 2 different sources (Forta + etherscan). We then trained our own tokenizer and transformer model on this dataset. We experimented with a few different model architectures and picked one that worked best. We deployed this model on a hosted endpoint.
For our front-end, we developed a MetaMask snap extension. This extension enables us to pull transaction data from MetaMask, and input this transaction data into our transformer model via our hosted endpoint. We take the result of the transformer's maliciousness score and determine the transaction to be malicious or benign. In the event that a contract is malicious, we proceed to simulate the transaction, as outlined in the next section.
For transaction simulation, we utilize Alchemy's transaction simulation API to dry-run potentially malicious contracts. We get the asset changes after contract simulation, and display these in the front end to verify the results of our model. Transaction simulation can be quite expensive in practice (both computionally and financially), so we designed our model to be able to filter out contracts that are benign and do not need simulation.