Smart Contracts

Blockchain is known to be used for store of value and as a financial platform (like a bank). Smart contracts are the answer to the question of what else can it do?

The answer, it turns out, is just about anything. Smart contracts are built using generalized logic and thus can perform any computationally feasible operation based on the inputs and modify its state and transfer value from its funds. A blockchain’s state can be more than just account balances. Smart contracts are user created rules that can define, update and change their own variables. The logic itself is ownerless and verifiable by anyone once it’s been deployed onto the blockchain.

The availability of smart contracts is a game changer for many industries, as they are automatic and verifiably trustless, thus offering significant cost-saving potential.

Code is Law

Smart contracts are written in a flexible and powerful programming language, enabling virtually any computationally feasible logic.

Anyone can audit the code and, once deployed, the code is immutable and can only do what its logic defines.

Environmentally Friendly

Smart contracts significantly reduces needs for labor, business processes, and paper trails–enabling the potential for a complete footprint-free system.

User Deployed Ecosystem

Anyone can use or deploy a smart contract with no restrictions.

User established EVM standards allow smart contracts to easily interoperate with each other, creating a collaborative ecosystem of DApps.

Programmable Value

Trustless logic is used to represent value of digital objects and variety of interactions, from direct transfers to more complex arrangements.

Case Study: Smart Contracts Lottery

Governments may use lottery to allocate public resources, including and not limited to: seats in popular schools, and quotas to purchase subsidized housing.

However, as the system is centralized, citizens worry about “fixed results”–a criticism hard to defend against. To solve this problem, ThunderCore worked with a city government team to put the entire lottery system into a smart contract! The contract is trustless, and its rules for lottery are auditable by anyone.

The first problem we focused on is seats for overfilled schools:

01

For each school, the government will deploy a smart contract with the given rules and number of seats available. These parameters are put on chain and are immutable.

02

Come enrollment time, the government will lock a hidden random number into the contract and start the enrollment period.

03

Parents can express their intention to enroll their children through email, phone number, fax or a web interface. The government will then verify that entry and add the enrollment into the smart contract. This process continues until the end date.

04

At the end date, the enrollment period will come to a close and a future block number will be selected to act as an additional source of entropy.

05

Once that block has passed, the government will reveal their initial random number along with the block hash to the smart contract.

06

The contract takes both the hash and the random number and selects the winners from all of the participants.

07

The results of the election are stored on chain and are permanent and immutable.

Transactions for applying and choosing winners are efficiently handled through the smart contract and the entire process is fair and verifiable.

X