简体   繁体   中英

What is the relationship between ethereum and solidity?

I am new to the blockchain. As I study solidity language, I can not figure out how it makes a blockchain in the end. I can map a contract to a class; but is it that every instance is a chain or what?

The relationship between Solidity and Ethereum is something like the relationship between Objective-C and iPhones. The former is a programming language used to write code that runs on the latter.

The actual implementation of the blockchain (the data structure, consensus protocols, etc.) is implemented in other languages (Go in the case of geth, Rust in the case of Parity).

As I study solidity language, I can not figure out how it makes a blockchain in the end

The Solidity programming language serves the sole purpose of allowing for the development of smart contracts on an Ethereum-based blockchain network. These smart contracts are simply the logic (code) that is triggered by internal or external actors (respectively users or other code) within the blockchain network and interpreted and executed by the Ethereum Virtual Machine (EVM) .

Solidity is not used to create the Ethereum blockchain network. The blockchain network must already be in existence for the smart contract logic to be deployed to the network. An Ethereum blockchain network can be created by any of the multiple Ethereum clients due to the unambiguous nature of the Ethereum protocols.

I can map a contract to a class; but is it that every instance is a chain or what?

Mappings in Solidity are a basic key/value data structure akin to a hash map. You can map keys of data type X to a value of data type Y. There is no explicit relation between Solidity mappings and the blockchain network itself.

Whenever a smart contract function is called, a transaction is subsequently created on the blockchain network that is representative of the executed function as well as the caller of that function. This transaction is persisted on the blockchain and serves as immutable proof that an action has taken place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM