Konubinix' opinionated web of thoughts

Smart-Contract

fleeting

Technology of a blockchain allowing to manipulate the underlying ledger. Some are event based, meaning transactions may be generated depending on what is happening on the blockchain.

They generally are composed of a smart-contract storage and entrypoints to get access to their functions.

We’ll define what Smart Contracts are and how they are already present on Bitcoin

https://opentezos.com/blockchain-basics/smart-contracts

Bitcoin Script is willingly non-turing complete

https://opentezos.com/blockchain-basics/smart-contracts

a Bitcoin script is unable to know and handle the transaction amount insidea Bitcoin script is unaware of anything happening outside the stack. It can’t access the blockchain data

https://opentezos.com/blockchain-basics/smart-contracts

you can’t use the balance of a private key inside the code

https://opentezos.com/blockchain-basics/smart-contracts

significant difference with systems like Ethereum, which have an account point of view:

https://opentezos.com/blockchain-basics/smart-contracts

smart contract is a piece of code stored inside the blockchain. It executes a set of pre-defined instructions (promises). Once deployed (stored), it becomes immutable. A smart contract is deployed using a transaction, so we embed spending conditions inside it, which are then immutable.

https://opentezos.com/blockchain-basics/smart-contracts/

Strictly speaking, a Bitcoin transaction is a smart contract. The promise to open the vault from one party is fulfilled, given that the other party has the right key to open it. Note that the way this key is provided is also meaningful here. It must follow protocols.

https://opentezos.com/blockchain-basics/smart-contracts/

If we can’t control the halt of the machine, it can start an endless loop.So the idea in Ethereum was to introduce another variable to stop the machine: Gas

https://opentezos.com/blockchain-basics/smart-contracts/

machine running on gas can’t move endlessly without enough gas

https://opentezos.com/blockchain-basics/smart-contracts/

Gas is the fuel of the Ethereum system and a sub-unit of the Ether currency. It is consumed with each operation

https://opentezos.com/blockchain-basics/smart-contracts/

miners who also execute these operations receive the Gas as fees for using their computational power

https://opentezos.com/blockchain-basics/smart-contracts/

Like in Ethereum, Tezos uses 2 types of accounts:Classic accounts with a primary address, to store tez (ꜩ)Smart contract accounts with an address, storing code and tez (ꜩ)In Tezos vocabulary, “contracts” refers to both types in general. Actually each contract has a “manager”. Precisely, a classic account has an “owner”. If a contract has the “spendable” property, the manager is the entity allowed to spend funds from it.

https://opentezos.com/tezos-basics/smart-contracts

The deployment of a Tezos smart contract is named “origination

https://opentezos.com/tezos-basics/smart-contracts

When a smart contract is deployed, an address and a corresponding persistent space called “storage” are allocated to this smart contract. The smart contract address is like its identity and where it lives on the ledger. Its storage is its usable space

https://opentezos.com/tezos-basics/smart-contracts

Notes linking here