The Capital: Blockchain for dummies (not so much anymore). Part II

  • Tuesday, 25 February 2020 00:23
By Daniel Ortiz on The CapitalIn this second post, we will see some Blockchain technologies and we will focus on knowing how Ethereum works.Reminder: if you need to quickly remember some Blockchain concept, take a look at my previous post before continuing with this second post. Once done, we can start!Main Blockchain TechnologiesBitcoinFirst virtual crypto-currency that was theoretically born along with the Blockchain manifesto created by Satoshi Nakamoto. Apart from what was mentioned in the first article, it is important to note that as the first technology to use Blockchain, all subsequent ones start from it. That is to say, many of its characteristics are inherited or retouched by later technologies like the ones we will see next.It was presented to the world as an alternative to “real” money since it is a currency that is not controlled by any organization or financial entity as if there were other currencies. But the reality is that it has encountered problems that are holding back expectations in that sense and that makes its practical approach not work. Problems such as increasingly higher mining times, society’s trust in the currency, corruption of miners to break the decentralization…EthereumIt is an open-source platform that provides everything needed to facilitate the construction of applications in Blockchain technology and everything that can be done on them: how to facilitate the currency transactions that are discussed in Bitcoin. It has its currency (ether) and most importantly, the big advance it introduces over Bitcoin is the concept of Smart Contracts.We will see more about Ethereum later on, so let’s not worry about it anymore for now.HyperledgerAn open-source project of the Linux Foundation created in late 2015 — early 2016. The aim is to take a further step in Blockchain technology by orienting the project towards the business world and private networks. Also, it includes everything necessary to carry out smart contracts that otherwise fit very well with its objectives.The project has Hyperledger Fabric which is where new functionalities are being developed. Some of these new features are docker integration, different types of contracts, frameworks and SDK (in Node.js), support for APIs…Going deeper into EthereumIn Blockchain, users have an identifier that represents their account from which they can send and receive currency. Since Blockchain is anonymous they are the holders of a private key. Protecting the private key is vital if someone were to gain access to it they would be able to make all available funds in the account disappear.Users can sign transactions using their private key. The content of the transaction being sent will be encrypted with the private key resulting in the signature.Signature = private key + messageIt will be easily verifiable by third parties to verify that the transaction was indeed issued by that user.The transactions that are normally executed in Ethereum are currency transactions between accounts, a user to user transactions. However, it differs from other implementations because we can also send transactions to smart contracts (explained at a later point).Format of the transactionsTxHash: hash of the transaction that uniquely identifies you. Timestamp: Date and time in which said the transaction was issued.Block: represents the block number where the transaction was included.Gas limit: indicates the maximum amount that the user is willing to pay us a commission for executing a certain transaction.Gas used: indicates the final amount spent on the transaction for that transaction.Gas price: price/unit of gas that was in force in that block. It is important to note that if a user who is going to execute a transaction sets a Gas limit lower than the gas price the transaction will be aborted and all changes made to that transaction will be reversed.Input data: data field that when a currency is sent will be empty, but when a transaction is made to smart contracts it will represent the code of the smart contract to which it is addressed or the data we send to interact with it.Most important fields of the blocks:Timestamp: it represents the date and time in which the block was generated.Transactions: it represents the list of transactions included in this block.Hash: unique hash identifier of the block.Prev Hash: Identifier of the previous block.Mined by: eth address of the miner who won the consensus algorithm.Difficulty: represents the difficulty value of the block used to adjust the mining difficulty.Gas used: total gas spent in commissions for all transactions included in this block.Gas price: maximum gas limit that the block had established.Nonce: solution provided by the miner to find a valid hash. It is included in the block so that all miners can verify its validity.Block reward: the amount of eth earned by the miner in total for validating the block (3 ethers + total of commissions paid by all users).Note that there is a genesis or initial state that refers to the first block in the chain and in which the fields can take on special value.Smart ContractsIn Ethereum a smart contract is a program that lives in the Blockchain and of which all nodes have a copy.It can execute and enforce itself autonomously and automatically without intermediaries or mediators in a decentralized way. Thanks to being digital contracts that specify their rules using a programming language there is no possibility of bad intentions as it is not something verbal or written.To be able to develop a smart contract in Ethereum we use the Solidity language. It is a typed language with a syntax very similar to Javascript but has additional capabilities related to the handling of transactions and currency in its design. Once we compile a smart contract developed with solidity it will be converted to machine code also called bytecode. The bytecode code will be sent in a transaction to the Ethereum Blockchain creating an instance of that contract.All the nodes have in their software the Ethereum virtual machine also known as EVM. This virtual machine can execute the bytecode code of smart contracts.So, that’s all Folks! I hope you liked this brief introduction to Blockchain in these two articles and that it helped you understand the technology better. See you in future posts!Daniel Ortiz Sánchez - Analyst Programmer - Keifi Technologies | LinkedInThe Capitalhttps://medium.com/media/3b6b127891c5c8711ad105e61d6cc81f/hrefBlockchain for dummies (not so much anymore). Part II was originally published in The Capital on Medium, where people are continuing the conversation by highlighting and responding to this story.

Additional Info

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.

Disclaimer: As a news and information platform, also aggregate headlines from other sites, and republish small text snippets and images. We always link to original content on other sites, and thus follow a 'Fair Use' policy. For further content, we take great care to only publish original material, but since part of the content is user generated, we cannot guarantee this 100%. If you believe we violate this policy in any particular case, please contact us and we'll take appropriate action immediately.

Our main goal is to make crypto grow by making news and information more accessible for the masses.