Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What would be an example of a "smart contract"?


A kickstarter clone, that could be implemented in a few lines of code on top of Ethereum..

If there is > 1,000 Ether in this contract address before timestamp x then send the Ether to the project lead, else refund all the users.


Nice! Thank you. You know there are many different types of contracts, why didn't they just call it 'smart transactions'?


Because it's conceptually more like a contract. Someone writes the contract code, and then by uploading and depositing money into the contract it's as if they signed it. After that point it works without anyone needing to trust the signer.

And they can include conditions about arbitrary information that is reported on the blockchain (weather data, stock prices, etc...)

And multiple people can sign these things. They really are like contracts.


Their main use case is maintaining critical/sensitive state information that you want to protect via rules of interaction between multiple parties (that don't trust each other) without the need for a trusted intermediary. The contract is tamper proof and only via correctly and cryptographically signing messages/transactions intended for the smart contract will the state of the smart contract change, but only according to the rules defined in the smart contract.

The (non-fintec) example I often hear about often is a voting system. (See: https://github.com/stonecoldpat/anonymousvoting , here zk-snarks algorithm is introduced to ensure privacy)

Essentially anything that requires co-ordination between parties that don't trust each other over a piece of data (a balance of money, the tally of a ballot) is a perfect use case for smart contracts. But since there is cost to running it on these secure networks it is important that they remain O(1) or at most O(n) time complexity, which for these kinds of applications is often totally enough. (eg. if (the message is signed by the 'owner') { send the funds } else { throw })


Basic smart contract found here:

https://blockgeeks.com/guides/smart-contracts/


Another interesting use case is for supply chain management, since the history of a interactions relating product can be documented in a secure manner Eg. you can buy a nike shoe that you can cryptographically validate that it was signed off by Nike, who made it, when they made it, when it was shipped, and even how much each of these parties got paid for their service. (Take a listen here: https://media.consensys.net/state-change-44-shining-a-light-...)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: