Omakasea NFT, Blockchain, and Ethereum Workshop Part 1

Omakasea NFT, Blockchain, and Ethereum Workshop Part 1


Rules and Basics to think beyond them.

  Special thanks to Teara for the original workshop.

  As we know, a blockchain is a chain of blocks that contain information, originally termed in 1991 by researchers who researchers who were seeking to create a tamper proof digital time stamp- this went largely unused until the Bitcoin Network was created in 2009. 
  How do blockchains work?

  Each block contains data, the hash of the block as well as the hash of the previous block. The hash is the unique fingerprint of the block. The type of information stored inside the block depends on the blockchain in use-  i.e.- BTC network block transaction data, while EVM networks block smart contract data. 
  Once a block is created, it’s hash is created and uniquely encrypted based on the information inside the block- therefore, if information inside the block changes, the chase inside the block will change, causing a noticeable chain reaction, as every block has the previous hash encrypted into it.

 The first block is called the Genesis Block. The hash from the Genesis Block will be in the second block, and the hash from the third block will have the hash from  the second block, which has the hash from the Genesis block in it. 
   Obviously this technology is excellent for noting any tampering, as every block would be affected.

   However, the blockchain itself is not enough to prevent tampering-  today’s computers could reconfigure hundreds of thousands of hashes per second, effectively changing the blockchain- that’s why Satoshi Nakamoto introduced the concept of Proof of Work to the Bitcoin Whitepaper in 2008.

   Proof of Work (POW) is a mechanism that slows down the creation of new blocks- 10 minutes to be exact. With this system, if a bad actor attempts to change the information in a block, they would have to change every subsequent block, and it would take ten minutes each block, for hundreds of thousands of blocks. 
   One more way that Bitcoin maintains its immutability and decentralized is by operating on a distributed ledger- a p2p network validated by node holders rather than a centralized entity.

   why Ethereum ???

 In 2009, the conceptualization of Proof of  Work was a huge step for decentralization- as it removes listing for participation, making the barrier for participation economic only.

  Merkle Trees-

   Merkle Trees are how Ethereum uses encryption to keep it’s ledger immutable. 
  Each block starts with a root hash- this root hash is connected and splits into two more hashes, each of those hashes being connected to their parent hash and splitting to two more each, and each of those hashes splitting into two more- and so on.

Transactions are logged into the hashes of these which are all interconnected- therefore, if any content in the block is altered by a bad actor, it would ultimately alter the hash, which would devalidate all hashes connected up to the root hash, which would also be altered and no longer be validated in the succession of the blockchain. 

  Ethereum Wallets 

  Something to keep in mind about a decentralized ledger such as Ethereum- even though we hold our coins and tokens in “wallets,” they’re actually not being held in an individual walleted account, as centralized bank entities hold money. All ethereum tokens reside in the contract(s)- while a wallet is a front end portal to access the tokens which the contract(s) dictate are yours to access. 
  
   Smart Contract Code Execution

   EVM (Ethereum Virtual Machine) code consists of bytes( pushed through by gas), each byte representing an operation.

  Execution is an infinite loop that repeatedly carries out the operation at the program counter (starts at 0) and increments the counter (by 1) until the end is reached or an ERROR or STOP or RETURN instruction is detected.

  Operations can store data in stacks, (interchangeable/ moveable pieces of data) memory, or a contacts long term storage.

  Code can access value, sender, and data of message, as well as block header data(think merkle tree), and can return a byte array of data as an output. 
   A basic implementation of Ethereum can be done in a few hundred lines of code. (Very simple.)

  Transactions vs Messages

 Transactions- Signed data packages, storing a message to be sent from an externally owned account. They include the following data: 

1. The reception today the message.

2. The signature which identifies the sender.

3. The amount of ether to transfer from the sender to the recipient.

4. An optional data field. 
5. A startgas value, the max number of computational steps the transaction execution is allowed to take. ( what are the max number of steps that will take to execute this transaction?)
6. A gasprice value, representing the fee the sender pays per computational step. (The current going rate to execute the startgas steps) 

The gas estimate for a transaction is calculated by multiplying the start gas value by the gas price value.

  Messages- Contracts can send messages to other contracts.

  Messages are virtual objects that are never serialized and only exist within the Ethereum execution environments. They contain: 
  - The sender of the message.

  - The recipient of the message.

  -  The amount of ether to transfer along with the message.

  - An optional data field.

  - A startgas value.

  Messages do not execute transactions, they’re just messages. 
  The point of startgas is to prevent malicious or infinite functions which could have a draining or wasteful effect on the network- the max number of steps ensure that the function is not executed if outside the startgas limit. 
Gas is the fundamental unit, typically one step costs one gas. 5 gas for every byte in transaction data. 
 In addition to paying the stakers of the network, the concept of gas uses economics to discourage bottlenecks and malicious intent- if someone wants to hijack the ethereum transaction board, it’s going to cost a TON of gas- if there’s a bank run on Ethereum DeFi protocols, gas will spike, incentivizing some to to hold. 
  
    Ethereum State Transfer Function

    The state of a blockchain is the most up to date report on who owns what per blockchain validation. 
 Before your transaction, the blockchain has a state. After your transaction, the blockchain has a different state. Although the blockchain itself will protect us from trading something for nothing (transactions that do not match the state of the blockchain revert and do not execute) - gas is still spent for attempted validation. To prevent wasting gas, the savvy can validate the state of the blockchain themselves before attempting a transaction that will face reversion. 

Stay tuned for part 2, in which we discuss what Ethereum can be used for, provenance, and metadata. 

 

Consider buying a PokeGan NFT.

  You'll gain so much more than the basic outlines here. 

  Tokengated lessons provided by Omakasea. 

  Follow me on Lens and Twitter. 

How do you rate this article?

36


vanassen.eth
vanassen.eth

Wading the waters of "Web 3.0". Want to come swimming? Follow me >>>>>>


understandingadoption
understandingadoption

A random string of articles with high quality content and news with viewpoints on digital assets from a wide range of voices and perspectives. Follow me on twitter @cryptopotestas.

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.