블록체인

Blockchain Overview

앜지 2024. 3. 17. 00:02

-블록체인이란:

▪ A blockchain is a distributed ledger with growing lists of records (blocks) that are securely linked together via cryptographic hashes

▪ 관리 대상 데이터를 '블록'이라고 하는 소규모 데이터들이 P2P 방식을 기반으로 생성된 체인 형태의 연결고리 기반 분산 데이터 저장 환경에 저장하여 누구라도 임의로 수정할 수 없고 누구나 변경의 결과를 열람할 수 있는 분산 컴퓨팅 기술 기반의 원장 관리 기술

원래는 trusted third party가 거래에 관여를 했다면 블록체인은 서로 연결된 분산 장부를 토앻 투명한 거래내역을 유지할수 있다.

 

블록체인 네트워크는 블록체인 노드들로 구성되어있다. 노드 안에 있는 블록체인 데이터베이스에서는 앞서 말했듯이 데이터를 하나의 블록으로 저장하여 다른 블록은 이 블록의 해시값을 가지므로 서로 무결성을 보장해주는 체인으로 연결이 된다.

-블록체인 네트워크

블록체인 네트워크에는 다양한 종류가 존재한다.

크게는 permissioned, permissionless,네트워크로 나눌수가 있다.

Permissionless Blockchain은 아무런 유저가 네트워크의 일원, 즉 Node가 될수 있도록 한다. 그렇기 때문에 하나의 transaction을 체인에 추가하는데 많은 node들이 검증을 하기 때문에 Permissioned Blockchain보다는 조금 더 보안이 뛰어나다. 그에 반대로 정해진 유저들만 네트워크에 참가할수 있는 Permissioned Blockchain에서는 보안성이 떨어지는 반면에 transaction을 처리하는데 더 적은 시간이 걸리기 때문에 더 효율적으로 처리를 할수가 있다.

그러면 위에 나타나 있는 4가지의 네트워크는

1.Public Blockchain:

주로 널리 알려져 있는 비트코인,이더리움같은 암호화폐가 이쪽에 속하며 모든 유저들이 블록체인에 대해 같은 권리를 가진다.

2.Private Blockchain:

Managed Blockchain이라고도 하며 하나의 주체가 블록체인을 관리를 하며 모든 노드에게 같은 권리를 주지는 않는다. 그래서 블록체인이 가지는 탈중앙화의 성질이 조금 덜하다고 한다. 예시로는 Hyperledger, Corda가 있다

3.Consortium Blockchain:

Consortium는 Private Blockchain처럼 하나의 주체가 블록체인을 관리하기 보다는 다수의 주체가 관리를 한다 예시로는 Tendermint, Multichain이 있다.

4.Hybrid Blockchain:

public, private의 성질이 섞인 blockchain으로, 일부 부분은 한 주체에 의해 관리되는데 다른 부분은 public처럼 모든 유저에게 공개가 되는 성질을 가진 blockchain이다.

 

-Node

Blockchain Node는 인터넷을 통해 블록체인 네트워크에 연결된 장치다.사용자는 Node를 통해 블록체인과 상호작용을 할수가 있다.

블록체인은 append only로 이루어져 있는 구조인데. 네트워크에 참여하고 있는 모든 노드들이 엄청나게 큰 블록체인의 모든 블록들을 다 가지고 있을수는 없고 어떤 노드들은 가지고 있고 다른 노드들은 일부만 가지고 있는 노드들로 이루어진다.

그래서 이렇게 블록체인 서버라고도 생각할수가 있다.

▪ Full Nodes : Full nodes are responsible for maintaining the entire transaction records in a blockchain network. ▪ They are regarded as the blockchain’s servers where the data is stored and maintained. 

▪ Pruned Full Nodes ▪ Pruned nodes are given a specific memory capacity to store data. memory capacity에서 차이가 난다. pruned는 일부만 가지고 있다.

▪ Archival Full Nodes ▪ Archival full nodes maintain the complete blockchain, and they differ from pruned full nodes in terms of memory capacity. 말 그대로 블록체인 전체를 가지고 있는 노드이다.

▪ Miner nodes ▪ These are the nodes that participate in verifying and updating transactions’ records on the blockchain network. mining을 하는 노드.Transaction이 발생했을때, 이 Transaction을 verify시켜준다. 그리고 업데이트를 시켜준다.

▪ Authority nodes ▪ Authority nodes are typically used in blockchains with vetting processes for selecting nodes.일종의 관리자 노드. private blockchain에서 관리를 하는 역할을 한다.

▪ Master nodes ▪ Master nodes validate transactions and verify new blocks but cannot add new blocks to the blockchain.

채굴을 하진 않지만 Transaction을 verify하는 역할을 가진다.

▪ Staking nodes ▪ These nodes validate transactions in a blockchain network and are responsible for maintaining the consensus algorithm. Consensus알고리즘에 따라서 Transaction을 validate시킨다.

▪ Light Nodes ▪ Light nodes prioritize essential data for immediate operation, processing only simple and fast transactions that do not require the entire blockchain.full node가 아닌 블록체인의 일부만 가지고 있는 빠르게 transactoin을 처리하는데 사용한다.

▪ Super Nodes ▪ Super nodes are used to perform certain special tasks and are implemented in some blockchains. ▪ It can be used to set or maintain the rules of a blockchain, implement a change in the protocol, etc.

▪ Lighting Nodes ▪ Lightning nodes connect the blockchain network to the lightning network, enabling smooth and efficient interactions.

- Wallet

: 일부 트랜잭션을 기록, 트랜잭션이 수행될때 사용되는 public, private key를 관리하는데 사용되는 소프트웨어 대표적으로 light node들이 wallet을 사용한다. 

크게 Hot Wallet, Cold Wallet으로 분류를 하는데 Hot Wallet은 인터넷에 연결되어 관리를 하는 스토리지이다. Cold Wallet은 아닌거고

hot wallet에는 온라인(클라우드) 지갑, 데스크톱이나 모바일 지갑이 있다.

cold wallet에는 usb나 진짜로 종이에 key를 입력해놓은것도 cold wallet이라고 할수가 있다.

-블록체인은 어떻게 작동하는가?

1. Facilitating a transaction:

블록체인에 새로운 트랜잭션이 등장한다.(예를 들어 A가 B에게 0.01BTC만큼 송금한다고 치자)이 트랜잭션은 public, private key를 사용해서 암호화 되어있다.

2. Verification of transaction: 이 다음 트랜잭션은 블록체인 네트워크에 전송되어서 P2P장치들은 이 트랜잭션이 적합한지 검증을 한다.(A가 계좌에 실제로 0.01BTC이상이 있는지)

3. Formation of a new block:

평범한 블록체인 네트워크에는 많은 수의 노드가 존재하기 때문에 트랜잭션은 짧은 시간안에 인증된다.트랜잭션이 인증이 된다면 mempool(블록체인에 추가되기 전에 일종의 대기실)에 추가가 된다.특정 노드에서 인증된 트랜잭션들은  mempool 을 형성하고 다수의 mempool들은 block을 생성한다.

4. Consensus Algorithm:

블록을 생성한 노드는 이 블록을 블록체인에 추가를 시켜서 영구적으로 하려고 한다. 그런데 모든 노드가 이 동작을 한다면 블록체인이 제대로 작동할수가 없다. 그래서 노드들은 consensus(합의 알고리즘)을 사용하여 블록체인에서는 추가되는 블록이 유일한 블록임을 확실하게 한다. 

블록체인에 블록을 추가한 노드는 보상을 지급받을것이다.그래서 그런 노드들은 miner라고 한다. consensus 알고리즘은 해시코드를 만들어서 블록을 네트워크에 추가시킬것이다.