1. 'WEB 3.0 / 탈중앙화'에 대한 설명
2. RPC에 대한 설명 (Remote Procedure Call)
- RPC : IPC (Inter Process Communication) 의 일종이며, 분산 computing에서는 다른 주소 공간에서 subroutine을 실행하는 프로세스를 의미함. Client와 Server로 나뉘어서, Client가 Parameter를 담아서 전달하면, Server에서 응답을 줌.
[RPC 시스템의 장점]
(1) app과 dApp을 다른 부분으로 나뉠 수 있어서 유용함 (seperate logic from representation)
(2) Data를 분리해서, security를 향상시킬 수 있어서 유용함
https://moralis.io/ethereum-rpc-nodes-what-they-are-and-why-you-shouldnt-use-them/
3. RPC Node : dApp으로 동작하려는 Blockchain과 Communicate 할 때 필요한 노드 (정보 접근, 거래 생성)
RPC = Straightforward API to execute code remotely = Function call과 유사 (다른 시스템에서 존재한다는 것만 제외하면)
RPC Node 의 역할 : Blockchain data를 읽고, 다른 네트워크에 transaction을 전송하는 역할 (RPC Call이 이 명령을 함)
[RPC Node를 직접 call하는 것의 단점]
(1) RPC Node와 직접 Communicate 하기 위해서는 다양한 resource가 투입됨. 따라서, 이것을 쉽게 해주는 방법이 고려되고 있음. 그 중 하나가 Moralis임
(2) redundant indexing, setting up a database, and figuring out how to search for information.
[Moralis 기능]
(1) Ethereum, BSC (Binance Smart Chain), Polygon, Arbitrum : 이렇게 4가지의 네트워크 활용
(2) Archive Nodes 활용 가능 (Archive Node : 전체 Blockchain에 대해서, snapshot을 찍어두었기 때문에 네트워크 정보 retrieve에 활용 가능)
4. JSON-RPC
Ethereum Client가 Ethereum Server와 Communicate 하기 위해 필요한 데이터 타입
[참고 링크]
https://moralis.io/ethereum-rpc-nodes-what-they-are-and-why-you-shouldnt-use-them/
Ethereum RPC Nodes - What They Are and Why You Shouldn’t Use Them » Moralis » The Web3 Development Workflow
Are you wondering whether two use Ethereum RPC nodes? Be sure to read our article on the topic - and then use Moralis instead!
moralis.io
5. Smart Contract
deFi (Decentralized Finance)
Smart Contract : codified agreements betw. parties
agreement가 인터넷 상에서 안전하게 실행되지만, 당사자들은 서로에 대해서 몰라야 함.
Bitcoin은 보안 위협 때문에 의도적으로 간소화된 smart contract를 사용했음
Ethereum은 'World Computer'로 불리었음, 전 세계에 있는 누구라도 이더리움의 네트워크에 조인할 수 있음
(EVM : Ethereum Virtual Machine)
Gas fee (transaction fee) = Smart contract code를 실행하는 데 필요한 비용
= node에 의해 빌려지고, 필요한 컴퓨팅 파워의 양만큼 gas fee가 측정됨
Solidity = Ethereum smart contract가 생성되는 프로그래밍 랭귀지 (primary coding language)
Solidity 특징 > contract-oriented (Javascript와 유사)
Solidity Smart Contract = Solidity 언어로 프로그램된 smart contract 이며, EVM의 bytecode로 컴파일 됨
6. Proof of Work
암호 증명 (Cryptographic Proof)의 한 형태
Prover (증명하려는 사람) 가 Verifier (증명 요구하는 사람) 에게 어떤 양의 컴퓨터 연산을 사용했음을 증명함
이런 식으로, Data의 조작을 막고, HW Control을 통제
7. What is Bitcoin mining
Bitcoin miner의 역할 : (블록에 포함되는) 복잡한 수학 암호문을 해결하여 거래 (transaction)을 Confirm and verify.
Miner가 받는 정보 : batch of transaction data를 노출하지 않는 hash 값을 생성함
hash를 생성하는 이유 : block이 방해받지 않았다는 것을 알기 위해
특징 : Previous block의 해시도 다음 블록에 포함됨
8. BlockChain System
Block : 데이터의 단위 / Chain : (의미) 데이터가 연결되어 있음
- 특징 : 네트워크의 모든 참여자들이 동일한 데이터를 분산 저장함 (원본과 사본의 구별이 없음, 분산화된 노드끼리 합리적이고 효율적인 의사결정을 내릴 수 있는 다양한 알고리즘이 개발됨)
- Canonical Chain (정격 체인) : 모든 노드의 확인 결과 거래 데이터가 일치하는 체인
- Consensus Algorithm (합의 알고리즘) :
Chain이 Fork되지 않고, 하나의 Canonical Chain이 생기도록 노드가 확인하는 시스템
- 합의 알고리즘 종류 :
(1) 작업 증명 (Proof of Work, PoW)
- 목표값 이하의 해시를 찾는 과정을 무수히 반복함으로써 해당 작업에 참여했음을 증명하는 방식의 알고리즘
- 모든 노드들이 찾아낸 해시값을 검증하고, 승인하는 과정을 거쳐 블록에 거래 내역을 저장함.
(2) 지분 증명 (Proof of stake, PoS)
- Block 생성, 합의 투표에의 참여 리워드로 받는 것이 Coin
- Byzantine Fault Tolerance (BFT) : 악성 노드가 거래 사실을 숨겼음에도 합의를 통해 시스템을 유지할 수 있는 방식
9. What is Hash
- 이전 Block의 Hash 값이 현재 Block의 Hash 값에 저장이 된다고 함.
- Bitcoin client 들은 항상 longest chain을 신뢰함.
각각의 Block은 3가지로 구성되어 있음 (Data / Hash of the Previous Block / Cryptograhic Nonce / Hash of Block, SHA-256 Algorithm)
블록의 Hash Value는 Block이 생성될 때 Generated 됨
또한, Block의 data가 변경되거나, Previous Block의 hash 값을 포함하고 있음)
즉, 맨 첫 Block (Genesis Block)이 생성되고 나서, new transaction이 발생하면, Block이 생성됨 (Block 은 Immutable함)
Miner의 역할 : transaction이 authenic 하다는 것을 증명하기
Mining : Validation method of transaction
(출처: A systematic Review of Blockchain for Consent Mana 논문)
10. SHA-256 : 어떠한 Input에 대해서도 256 bits를 만들어내는 암호화 알고리즘, 64-Digit Hexadecimal Number
Secure Hash Algorithm
Bitcoin uses 'SHA-256' in verifying transaction
<SHA가 안전한 이유>
1) Hash Value에서 Initial Data를 reconstruct 하는 것이 불가능함.
2) Having two messages with the same hash value is extremely unlikely. (Collision)
3) Original Data에서 Minor Change를 만들면 Hash value의 값이 dramatic하게 변경됨
https://www.n-able.com/blog/sha-256-encryption
11. Proof of Work
Predefined value 값보다 더 낮은 hash value를 갖기 위해
(Predefined value : 해당 Block이 네트워크로부터 부여 받은 숫자의 길이)
12. Merkle Tree
What is Merkle Tree?
https://www.simplilearn.com/bitcoin-mining-explained-article
13. Cryptographic Nonce
Every 2016 Block 마다 difficulty를 조정함.
Miner는 Hash Value가 Target 보다 이하로 나올 때까지 값을 조정함
Miner가 puzzle을 풀려고 노력하고, 가장 먼저 푼 사람이 Bitcoin을 reward로 받음
(fixed bitcoin award is offered for every block that is mined.)
Bitcoin은 2100 만개로 한정되어 있음. (Its coin supply is limited)