Dylanの博客

记录生活,记录成长

0%

Week1.1_Basic Blockchain

Week1.1_Basic Blockchain

1.学会开发NFT合约(可OPEN SEA 直接发布NFT

智能合约:①建立与ETH互动的合约

​ ②NFT要能够被MINT

​ ③NFT要能够设置总量

​ ④NFT要能够设定每个地址最大持有量

​ ⑤NFT要能够限制单次的mint量

​ ⑥NFT要能够设定开关去公开发售

  1. https://faucets.chain.link/rinkeby
  2. https://fauceth.komputing.org/
  3. https://faucet.rinkeby.io/

2.Beginner to Expert Python Tutorial

This course will give you a full introduction into all of the core concepts in blockchain, smart contracts, solidity, NFTs/ERC721s, ERC20s, Coding Decentralized Finance (DeFi), python and solidity, Chainlink, Ethereum, upgradable smart contracts, and full stack blockchain development.
Follow along with the videos and you’ll be a blockchain wizard in no time!
💻 The repository with helpful links to all code, resources, and support forums is located here: https://github.com/smartcontractkit/f…
Please reference the repo for anything you need, and feel free to leave issues, jump into the discussions, and more.
⭐️ Course Contents ⭐
⌨️ (00:00:00) Introduction
⌨️ (00:06:33) Lesson 0: Welcome To Blockchain
⌨️ (01:31:00) Lesson 1: Welcome to Remix! Simple Storage
⌨️ (02:09:32) Lesson 2: Storage Factory
⌨️ (02:26:35) Lesson 3: Fund Me
⌨️ (03:26:48) Lesson 4: Web3.py Simple Storage
⌨️ (04:27:55) Lesson 5: Brownie Simple Storage
⌨️ (05:06:34) Lesson 6: Brownie Fund Me
⌨️ (06:11:38) Lesson 7: SmartContract Lottery
⌨️ (08:21:02) Lesson 8: Chainlink Mix
⌨️ (08:23:25) Lesson 9: ERC20s, EIPs, and Token Standards
⌨️ (08:34:53) Lesson 10: Defi & Aave
⌨️ (09:50:20) Lesson 11: NFTs
⌨️ (11:49:15) Lesson 12: Upgrades
⌨️ (12:48:06) Lesson 13: Full Stack Defi
⌨️ (16:14:16) Closing and Summary
✏️ Course developer by Patrick Collins, check out his YouTube channel for more great programming courses, blockchain education, and fun: https://www.youtube.com/c/patrickcollins
Follow Patrick!
🐦Twitter: https://twitter.com/PatrickAlphaC
📺YouTube: https://www.youtube.com/channel/UCn-3…
✍️Medium: https://medium.com/@patrick.collins_5…
💻GitHub: https://github.com/PatrickAlphaC
🏢LinkedIn: https://www.linkedin.com/in/patrickal…>

⌨️ (00:00:00) Introduction
⌨️ (00:06:33) Lesson 0: Welcome To Blockchain

​ Dapp =Smart Contract =Decentralized App

​ Understanding Ethereum means we will understand the majority of these platforms.

​ Bitcon was the first one to take blockchain mainstream.

​ Bitcon is like a digital gold.

​ Ethereum allows for smart contracts.

​ chainlink provides data and external computation to smart contracts.

Features and massive advantages of blockchain and smart contracts:

​ 1.decentralized

​ 2.Transparency& flexibility. We can see every changes in the chain. Everyone follow the same rules.

​ 3.Speed and efficiency

​ 4.security and immutability

​ 5.Removal of counterparty risk

​ 6.Trust minimized agreements

​ 7.Hybrid Smart Contracts combine on and off-chain

Download metamask:

1
2
3
4
5
6
7
8
9
10
11
	Gas: Measure of computation use

​ Gas Price: How much it costs per unit of gas

​ Gas Limit: Max amount of gas in a transaction

​ Transaction Fee: Gas Used x Gas Price

​ ie:21,000 gas @ 1 GWEI per gas = 21.000 GWEI

​ Ethgasstaion: https://ethgasstation.info/

How the blockchain works?

Hash: A unique fixed length string, meant to identify a piece of data. They are created by placing said data into a “hash function”

Hash Algorithm:A function that computes data into a unique hash

​ SHA256: https://andersbrownworth.com/blockchain/hash

​ The nonce is the solution to the problem(mining nonce)

​ Genesis block:the first block in the blockchain

​ demo of distributed blockchain: https://andersbrownworth.com/blockchain/distributed

Mining:The process of finding the “solution” to the blockchain “problem”.

​ In our example, the “problem” was to find a hash that starts with four zeros.

​ Nodes get paid for mining blocks.

Block: A list of transactions mined together

Decentralized: Having no single point of authority

Private Key->>>Public Key->>>>>address

Blockchain nodes keep lists o f the transactions that occur

Consenus: the mechanism used to agree on the state of a blockchain

1.Chain Selection

—Nakamoto Consensus(a combination of proof of work and longest chain rule the decentralized)

)

2.Sybil Resistance

–proof of work(ETH/Bitcon) miner

–proof of stake validators

Proof of Work uses a lot of energy

Transaction fee- first one to find the transaction

Block reward - first node to solve the problem

Gas fees are paid by whoever makes the transaction.

Two types of Attack:

1.sybil attack:when a user creates a whole bunch of pseudo-anonymous accounts to try to influence the network

2.51% attack: some one have longest chain and more than 51 percent of the rest of the network can fork

Longest chain rules: Other nodes always follow the longest chain

Proof of Stake

avalanche solana polygon polkadot and terra and Ethereum2.0 using it

How it works? —-Proof of stake nodes put up collateral as a sybil resistance mechanism

Randomness –choose the random node

Proof of stake use much less energy

Sharding:Eth2.0 implemente this new methodology called sharding to sovle the scalability problem(分片) . which can incredibly increase the number of block space and greatly increase the number of transactions on a blockchain

Layer 1: Base layer blockchain implementation

Layer 2: Any application built on top of a layer 2

Rollups: a rollup is kind of like a sharded chain they derive from the layer one like ethereum and they bulk send their transactions onto the layer one.(Unlike side chains:because side chains derive their security from their own protocols)

Conclusions:

  • ETH and BTC are Proof Of Work(at the time of recording)
  • ETH 2.0 will be Proof of Stake
  • PoW & PoS are sybil resistance mechanisms
  • The bigger the blockchain,the more secure
  • Consensus is how blockchains decide what the state of the chain
  • Sharding and rollups are scalabilityb solutions
  • Only so many transactions can fit into a block
  • Gas prices are how much it costs to perform executions on-chain