Solidity for Beginners

Solidity for BeginnersIntroduction to the Smart Contracts Programming LanguageThe Cryptocurrency ConsultantBlockedUnblockFollowFollowingMay 22Solidity is a contact-oriented programming language for writing intelligent contracts.

It is used to implement Smart Contracts on various blockchain platforms and developed by some former Ethereum employees — originally only for the blockchain platform Ethereum.

Later, the programming language was also used on other blockchains.

Development of the Ethereum Blockchain programming languageSolidity was originally conceived in August 2014 by Gavin Wood.

The language was later developed by the Solidity team of the Ethereum project, led by Christian Reitwiessner.

It is one of four languages (the others are Serpent, LLL, Viper (experimental) and Mutan (obsolete), designed specifically for the Ethereum Virtual Machine (EVM) and is currently used as the main language on Ethereum and other private blockchains.

Users can use Solidity in their browser without having to download anything.

This application only supports compilation — if users want to execute the code or include it in the blockchain, they must use a client like AlethZero.

With Solidity, developers are able to write applications that implement self-reinforcing business logic anchored in intelligent contracts, leaving an irrefutable and binding record of transactions.

Solidity VerificationIn fact, it is a deliberately slimmed down programming language with a syntax very similar to that of ECMAScript (Javascript).

Programmers are working with a stack-and-memory model with a 32-byte command word size that gives EVM access to the “stack” program, which is structured like a register space and in which memory addresses can be stored to create the program counter loop/jump (for sequential program control), an expandable temporary “memory”, and a more permanent “memory” that is actually written.

This demand for determinism is the reason why users will not see the “random()” function in the solidarity language.

When a block is “disintegrated”, the smart contract implementations and function calls within that block (i.

e.

those executed within the last block duration) are executed on the node that disintegrates the block, and the new state changes to all storage locations or transactions within that smart contract that actually take place on that Miner node.

Then the new block is transferred to all other nodes and each node tries to verify the block independently, which also means that it makes the same state changes to its local copy of the blockchain.

The process will fail if the smart contract is non-deterministic.

If the other nodes cannot reach a consensus on the state of the blockchain after the new block and its contracts have been executed, the network could literally come to a standstill.

For this reason, Ethereum’s Smart-Contracts (and Smart-Contracts in general in any blockchain system) must be deterministic: so that the network of nodes can always validate and maintain the consensus about the new blocks arriving in the block in order to continue to run.

Solidity Smart Contracts @http://solidity.

readthedocs.

ioNo external accessAnother limitation that users find in EVM Smart-Contracts is the inability to access data outside of “memory” and “memory” (it is not intended that the Smart-Contract can read or erase the hard disks of the nodes on which it runs), and the inability to query external resources like a JQuery.

When users call a Smart-Contract that performs state changing work or calculation (any action except simply reading from memory), the Smart-Contract will incur power costs for its work and these are related to the amount of computational work required to perform the function.

It is a kind of “micropayment for microcomputing” system where you can expect to pay for a certain amount of electricity for a certain amount of calculations.

Smart Contracts at SoliditySmart-Contracts have their own addresses from which they can receive and send Ethereum.

Intelligent contracts can trace the “caller” of the function so that it can be determined whether one of its functions is called by a privileged “owner” or “admin” account and can act accordingly administratively.

Users can read data from the Ethereum blockchain and access information about transactions in older blocks.

But are smart contracts “locked” into their own small deterministic world, only able to know the data stored in the Ethereum blockchain itself?Not at all!.This is where the “oracles” come into play.

Users can turn a call into an oracle that trustworthily tells something about the outside world and reacts to this data within the framework of the intelligent contract.

The crux of the matter is that, although the real events themselves are not deterministic, the oracle can trust that it will always respond deterministically to each node’s requests about what is happening so that all nodes can still reach a consensus.

.. More details

Leave a Reply