Monday, July 24, 2017

How smart-contract is possible in blockchain ?

The idea was derived from the scripting support in bitcoin. Part of bitcoin transaction contain a Script, a stack based language that will be executed to verify the transaction. Complex conditions can be expressed in this language, which has 80 different opcodes including arithmetic, bitwise operations, string operations, conditionals, and stack manipulation.

This language however still pretty limited, such as not having loop and thus not Turing complete. So new blockchain implementation like Etherium expand the idea further to include support for real programming language, thus enabling more complex conditions to the blockchain transaction, which now commonly known as smart-contract.

Side note, making bitcoin transaction in python.