0% found this document useful (0 votes)
11 views8 pages

Blockchain _ Solidity _ Web3.0

The document provides an overview of blockchain technology, including definitions of key concepts such as Web3, smart contracts, and decentralized applications (Dapps). It discusses the importance of security, gas fees, and the Ethereum network, along with explanations of mining, consensus mechanisms, and the role of oracles. Additionally, it includes links to resources and demos for further exploration of blockchain and Solidity programming.

Uploaded by

Giulianna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views8 pages

Blockchain _ Solidity _ Web3.0

The document provides an overview of blockchain technology, including definitions of key concepts such as Web3, smart contracts, and decentralized applications (Dapps). It discusses the importance of security, gas fees, and the Ethereum network, along with explanations of mining, consensus mechanisms, and the role of oracles. Additionally, it includes links to resources and demos for further exploration of blockchain and Solidity programming.

Uploaded by

Giulianna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

24/05/2023

BLOCKCHAIN / SOLIDITY / WEB3.0

Índice
Índice
Link al repo
Blockchain Demo
Definiciones
Anotaciones Interesantes
Seguridad
Blockchain Explanation
Gas Fees and Cost per Transaction

Link al repo
https://github.com/smartcontractkit/full-blockchain-solidity-course-js/blob/main/README.md

Blockchain Demo
https://andersbrownworth.com/blockchain/block

Definiciones
● web1: permissionless open sourced web with static content

● web2: permissioned web, with dynamic content. Where companies run your
agreements on their servers.

● web3: The permissionless web, with dynamic content. Where decentralized


censorship resistant networks run agreements and code.

● smart contracts: smart contracts are a set of instructions executed in a


decentralized way, without the need of a centralized or third party intermediary.
Instead of the instructions and conditions written in code, all these things are written
in code embodied in some decentralized blockchain platforms.

● Blockchain Oracle: Any device that interacts with the off-chain world to provide
external data computation to smart contracts.
● Oracle problem: The blockchain oracle problem refers to the inherent inability of
blockchains to access external data (blockchain is immutable). It is immutable
because we have thousands and thousands of nodes that form the blockchain, so we
would need to have an infinite compute power to do this. Instead, in normal contracts
we have only one node in which the information is stored, so we just need to change
the information in this node.

● Hybrid smart contracts: These are formed by on-change and off-change


agreements (Chainlink - Decentralized Oracle Networks/DONs).

● Dapp: Decentralized application = Decentralized protocol = smart contract.

● DAOs: Decentralized anonymous organizations.

● GAS: Gas refers to the unit that measures the amount of computational effort
required to execute specific operations on the Ethereum network.

● Block Time: How much time it takes between blocks being published.

● Consensus: is the mechanism used to agree on the state of a blockchain. For


example, if one node changes something, and other two do not, the majority wins,
and the malicious or damaged blockchain is discarded. This is part of the so-called
“Consensus”. However, it is more complex and it can be divided into two parts: Chain
Selection and Sybil resistance mechanism.

- Sybil resistance mechanism: Which of all the nodes was the author of a
mining operation, so all the other nodes can verify this is accurate. this
mechanism is a way to avoid the malicious users that create a large number
of pseudo anonymous identities to gain a disproportionately advantageous
influence over the set system.

● PoW (Proof of work): a single node has to go through a very


computationally expensive process called mining to find the correct
Nonce. It does not matters how many pseudo anonymous identities
the malicious person create, it still has to make a computationally
expensive activity to find the answer to the proof of work problem (find
the Nonce, etc)

● PoS (Proof of Stake): It is a way to decide which user or users


validate new blocks of transactions and earn a reward for doing so
correctly.

● Sharding: is a solution to the scalability problem of the blockchain (as more people
use the blockchain, the more transactions are going to cost). The plan is to have a
Main Chain that is going to coordinate everything amongst several chains that hook
into his main chain. That means that there are more chains for people to make
transactions.
● Layer 1: Base layer of a blockchain implementation (BTC, Etherium, etc)
● Layer 2: Any application built on the Layer 1

Anotaciones Interesantes
● Bitcoin actually has smart contracts, but they are “turned off”. The developers saw it
as just a store of value.

● Robinhood and uniswap are decentralized exchanges, they can not stop the
operation of one specific asset.

● When developing never use a wallet with real founds

● We have different networks in our Metamask, the Ethereum Mainnet is the main
network of Ethereum, where the real money is traded. For developing and testing we
will have other networks (test networks), in these networks we will test our smart
contracts.

● The way to put fake money into our wallet in the ethereum test network is going to
Testnet Faucets, linking our account, and sending a transaction.

● Our account address is a derivative from our public Key.

● The more people use the Chain, the more expensive it is to send transactions.

● We need a real testnet to work with oracles, for example when we want to get the
actual price of a Eth (not the JSVM).

● We can import code directly from github, for example the AggregatorV3Interface to
connect to api with eth price.

Seguridad
● Metamask:
- Mnemonic: can access to all the accounts in your Metamask
- Private key: can access to 1 account in your Metamask (one pk for each
account)
- Public Address: its public and can not access to nothing

Blockchain Explanation
explanation video: https://youtu.be/_160oMzblY8

● Hash: is a unique identifier that represents some information, for example:


Joao ->
abc778a20e9ec910dd26a465ab20749e78586355de39eebec77fb9bd280bf436
Joao Pinto ->
2d09d55282b482da6e8f5cdec16829773982f724674a09f072d0dda917c32b67

it always has the same length, no matter what. This is called a digital fingerprint of
this data.

● Block: is a space that consist in four fields:

- Block:: the number of the block


- Nonce: a number that is used arbitrarily to set a hash that starts with four
zeros, so the block is signed
- Data: the data of the block
- Hash: the Hash that represents the block

(if the Hash starts with four zeros, then we say the block is signed)

So, when we change some information in the block. and the block is signed, we know
that the Hash is going to change, and the probability of getting a new generated
Hash with four zeros is pretty low, so this modified block will not be signed. To set
our modified block as signed, we will have to set a new arbitrarily Nonce, so a new
Hash is generated and it starts with four zeros.

Finding this new Nonce is very hard, and it is called mining.

● Blockchain: So a blockchain is just a set of all these blocks put together. Each of
them has to be signed to be valid in the chain.

for each block:


- Block:: the number of the block
- Nonce: a number that is used arbitrarily to set a hash that starts with four
zeros, so the block is signed
- Data: the data of the block
- Previous Hash: is a pointer to the hash of the previous block, so we can make
the connection in the chain
- Hash: the Hash that represents the block

The problem with the blockchain is that if we change one block, this gets invalid, and
the rest of the following blocks are going to get invalid too. This happens because the
block next to the block with problems uses the invalid hash as its previous hash, this
affects its own hash (because this change generates a new one), making it invalid
too, this repeats with each of the following blocks. To fix this, we will have to mine all
the broken blocks.

● Distributed: we will have a lot of Peers, each peer will have a copy of all the
blockchain, so for example, if we have three Peers, actually we will have three copies
of the same blockchain.
If we change the blockchain of one Peer, we will have then a Peer with one
blockchain and other two Peers with another blockchain, it can be noticed that the
one different Peer has a problem, we know that because we have a relation 1:2.

● Tokens: We have a blockchain copy in each Peer, and each block have some data,
this data actually can be, for example, a list of transactions.

● Transaction Signature: When a Transaction is done it generates a Signature, with


this Signature the transaction has a valid and unique code. The signature is
generated with our Private key and it can not be reversed to get our private key. The
transaction can be verified by anyone with our public key.

Gas Fees and Cost per Transaction


● Wei: 1000000000000000000
● Gwei: 1000000000
● Ether: 1

● Gas Fees: this costs Ether; however, the amount is so minimal that it is measured in
Gwei. It has a minimum price in Ether (Base), and a maximum price (Max).

● Gas limit: the maximum amount of GAS that we are willing to pay in this transaction.

● Usage by Txn: how much GAS was actually used in the transaction.

● Burnt: (Gas Fee) x (Gas limit and usage by Txn) = Burnt Ether. The Burnt Ether is
removed forever from circulation, it comes from our wallet when we make the
transaction.

● Transaction Fee: it comes from our wallet too, but is not burnt, it goes to the miners
that made the transaction possible.

EVM Overview
Contracts transaction fields

Diagram of how chainlink gets the price for a


specific asset (uncentralized)

the data providers get the data from the different exchanges, then, the info collected by the
data providers goes thru the uncentralized chainlink nodes, then we get the information for
out contracts
Chainlink VRF (Verifiable Random Function)
Blockchains are deterministic structures by default that means by concept that we can not
set randomness to these environments, a way to secure some randomness is the use of
chainlink VRF.
Chainlink Keepers
Decentralized event driver execution. It turns our smart contracts into hybrid contracts, given
them access to the real world data and services while maintaining the security and reliability
guarantee inherent in the blockchain technology.

You might also like