author: aman
Blog VII - Part I - Day 19
So, towards an end of this series.
I was quite busy in some other blog so couldn’t write this one quickly.
In this blog I’ll take up a case of a Security tool used in Ethereum Smart Contract bug discovery, ECHIDNA. I’ll try to unwrap a few things about how a security can be used to analyse a “script”, that governs the business of an organistion over Blockchain network. I’ll try to cover almost everything taught last time in these 2 upcoming micro-blogs.
Let’s take a look what’s coming up…
In this micro-blog
- One thing you can’t believe in…
- Fuzzer
- Echidna
- the Trail
One thing you can’t believe in…
You might be having this strong image of BLOCKCHAIN, that a fraudulent transaction in a Blockchain cannot be reversed. Well…what is I say, it is actually inaccurate.
One of the famous article in MIT Technology Review, by Mike Orcutt, titled as “Once hailed as unhackable, blockchains are now getting hacked”, stated the following:
“Blockchains are particularly attractive to thieves because fraudulent transactions can’t be reversed as they can be in the traditional financial system.”
The statement is actually inaccurate!
Ethereum classic is an example to it. Remember, I’ve told you people before about the famous DAO attack. The had a massive $50 million money heist. Well the attacker is still a mystery.
The funds stuck until July 14, 2016. See the article. The possibility of attack was due to a vulnerable smart contract, that governs the functioning of DAO.
This was the problem until the Ethereum Chain was forked, after a long debate among the community. The transaction was rewritten in the new chain and now there exists 2 ethereum chain. One, that we use now, and where the DAO attack never happened. The other one, Ethereum Classic, where the DAO attack happened.
This is a note published by Vitalik Buterin, the founder of Ethereum Blockchain.
Strange!! yeah…?
Lets try to know about something which is used as a help to “not” get into such troubles…
Fuzzer
Prevention is better than cure! Since, every crucial thing from a developer side depends on how well the contracts are written. If the contract does not release any possibility of attack, any loopholes of information leakage, the contract is probably secure.
Just like normal computer programs, there exists this old and always alive Computer Science (we may call it fundamental though). Analysing the programs statically and in dynamic environments to detect the bugs that can be triggered or are automatically getting triggered.
There are several techniques to anlayse a program. Symbolic analysis, Dynamic Analysis, Model Checking, Fuzzing…
There had been a lot of Security Tools in development recently. Here is a sophisticated list of all, in the official listings of CONSENSYS.link
I will talk a bit about the only fuzzer system available for Smart Contract Analysis, by an Argentanian company TrailofBits. The tool is known as ECHIDNA.
ECHIDNA
**pretty logo! isn’t it?
ECHIDNA, is a property-based fuzzer system available for generating malicious inputs and break the smart contracts. It means, we write a certain property(like the one a system should “always” follow, or should “never” follow), and the system runs it on a local virtual machine, which is inbuilt with the tool. The system starts fuzzing. i.e. inputting the contract with random inputs, to check where the system fails the written property. These inputs are determined by input generation techniques, which are certainly in “possible limits” tha EVM can handle, and are not that arbitrary.
The tool is written in HASKELL, which is a FUNCTIONAL PROGRAMMING LANGUAGES, which you probably have never heard about. This means the code is short and does a lot. To give a intuitive brief, the Functional programming language are actually concerned about “What the thing is?” rather than “How the thing works?”. Most of the SAT/SMT solvers, that I have talked about before are built over functional programming languages.
How ECHIDNA works? from user’s point of view You write a smart contract with certain invariants(the property you think should never change and the smart contract should always follow). Then you run that within the system.
the Trail
After discussing all this… you must have got a great idea about what is actually going out around the world.
The next blog will be a very special Connect the dots… thing. Will have no technical knowledge.
I will just cover the things I & the 2 guests Kaushik & Gaurav has compiled for you people.
Will finally unveil the “The Road Not TAKEN…“