Skip to content

Commit

Permalink
๐ŸŽจ Style : clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
ooMia committed Jul 23, 2024
1 parent d941640 commit 9b33cbe
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 39 deletions.
70 changes: 35 additions & 35 deletions concepts/Consensus/PoS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Proof of Stake

# About PoS

---
Expand All @@ -9,12 +10,11 @@ Validator๊ฐ€ ๋„คํŠธ์›Œํฌ์— ์ง€๋ถ„์„ ์Šคํ…Œ์ดํ‚นํ•˜์—ฌ ํŠธ๋žœ์žญ์…˜(ํ˜น์€

---

validator๊ฐ€ ๋˜๊ธฐ ์œ„ํ•ด, user๋Š” 32ETH๋ฅผ ์ปจํŠธ๋ž™ํŠธ์— ์˜ˆ์น˜ํ•˜๊ณ , execution client, consensus client, validator client์ด ์„ธ ๊ฐœ์˜ software๋ฅผ ์‹คํ–‰์‹œ์ผœ์•ผ ํ•œ๋‹ค.
validator๊ฐ€ ๋˜๊ธฐ ์œ„ํ•ด, user๋Š” 32ETH๋ฅผ ์ปจํŠธ๋ž™ํŠธ์— ์˜ˆ์น˜ํ•˜๊ณ , execution client, consensus client, validator client์ด ์„ธ ๊ฐœ์˜ software๋ฅผ ์‹คํ–‰์‹œ์ผœ์•ผ ํ•œ๋‹ค.

ETH๋ฅผ depositํ•˜๋ฉด, user ๋Š” ์ƒˆ๋กœ์šด validator๊ฐ€ ๋„คํŠธ์›Œํฌ์— ๋“ค์–ด์˜ค๋Š” ๊ฒƒ์„ ์ œํ•œํ•˜๋Š” activation queue์— ๋“ค์–ด๊ฐ€๊ฒŒ ๋œ๋‹ค. activate๋˜๋ฉด, validator๋Š” ๋‹ค๋ฅธ validator node๋กœ๋ถ€ํ„ฐ ์ƒˆ๋กœ์šด ๋ธ”๋ก์„ ๋ฐ›๊ณ (propose๋ฐ›์Œ), propose๋œ Ethereum์˜ state ๋ณ€ํ™”๊ฐ€ validํ•œ์ง€ ๊ฒ€์‚ฌํ•ด๋ณด๊ธฐ ์œ„ํ•ด ํŠธ๋žœ์žญ์…˜๋“ค์„ ๋‹ค์‹œ ๊ฒ€์ฆํ•˜๊ณ , ๋ธ”๋ก์— ์„œ๋ช…๋œ ์„œ๋ช…์„ ๊ฒ€์ฆํ•˜๊ฒŒ ๋œ๋‹ค.

> ์›๋ฌธ: The transactions delivered in the block are re-executed to check that the proposed changes to Ethereum's state are valid, and the block signature is checked.
>
๊ทธ ๋‹ค์Œ, validator๋Š” ๋„คํŠธ์›Œํฌ๋ฅผ ํ†ตํ•ด ๋ธ”๋ก์— ๋Œ€ํ•œ favor๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” attestation message(ํˆฌํ‘œ)๋ฅผ ๋ณด๋‚ด๊ฒŒ ๋œ๋‹ค.

Expand All @@ -23,46 +23,45 @@ ETH๋ฅผ depositํ•˜๋ฉด, user ๋Š” ์ƒˆ๋กœ์šด validator๊ฐ€ ๋„คํŠธ์›Œํฌ์— ๋“ค์–ด์˜ค
---

1. user๊ฐ€ transaction์— privatekey๋ฅผ ์ด์šฉํ•ด ์„œ๋ช…
โ†’ wallet๋˜๋Š” library์— ์˜ํ•ด ์ž‘๋™ or RPC๋ฅผ ์ด์šฉ
โ†’ user๋Š” validator๋กœ ํ•˜์—ฌ๊ธˆ ํŠธ๋žœ์žญ์…˜์„ block์— ํฌํ•จํ•˜๋„๋ก ํ•  ์ˆ˜ ์žˆ๋Š” ๋™๊ธฐ๋ฅผ ์ฃผ๋Š” Gas limit์„ ์ •ํ•จ
โ†’ Base fee๋Š” Burn๋˜๊ณ , ๋‚˜๋จธ์ง€๊ฐ€ ์ „๋‹ฌ๋จ. โ†’ Base fee์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž

โ†’ wallet๋˜๋Š” library์— ์˜ํ•ด ์ž‘๋™ or RPC๋ฅผ ์ด์šฉ

โ†’ user๋Š” validator๋กœ ํ•˜์—ฌ๊ธˆ ํŠธ๋žœ์žญ์…˜์„ block์— ํฌํ•จํ•˜๋„๋ก ํ•  ์ˆ˜ ์žˆ๋Š” ๋™๊ธฐ๋ฅผ ์ฃผ๋Š” Gas limit์„ ์ •ํ•จ

โ†’ Base fee๋Š” Burn๋˜๊ณ , ๋‚˜๋จธ์ง€๊ฐ€ ์ „๋‹ฌ๋จ. โ†’ Base fee์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž

2. transaction์€ node์˜ execution client๋กœ ์ „์†ก๋˜์–ด ํŠธ๋žœ์žญ์…˜์˜ validity๋ฅผ ๊ฒ€์ฆ๋ฐ›์Œ.
โ†’ sender์—๊ฒŒ transaction์„ ์‹คํ–‰์‹œํ‚ฌ ์ˆ˜ ์žˆ๋Š” ์ถฉ๋ถ„ํ•œ ETH๊ฐ€ ์žˆ๋Š”์ง€ ๊ฒ€์ฆ
โ†’ ์˜ฌ๋ฐ”๋ฅธ key๋ฅผ ์ด์šฉํ•ด ์„œ๋ช…ํ–ˆ๋Š”์ง€ ๊ฒ€์ฆ

โ†’ sender์—๊ฒŒ transaction์„ ์‹คํ–‰์‹œํ‚ฌ ์ˆ˜ ์žˆ๋Š” ์ถฉ๋ถ„ํ•œ ETH๊ฐ€ ์žˆ๋Š”์ง€ ๊ฒ€์ฆ

โ†’ ์˜ฌ๋ฐ”๋ฅธ key๋ฅผ ์ด์šฉํ•ด ์„œ๋ช…ํ–ˆ๋Š”์ง€ ๊ฒ€์ฆ

3. execution client๋Š” ์ด ํŠธ๋žœ์žญ์…˜๋“ค์„ local mempool์— ์ถ”๊ฐ€ํ•จ(list of pending transactions)
4. execution layer gossip network์˜ ๋‹ค๋ฅธ ๋…ธ๋“œ๋“ค์—๊ฒŒ ํŠธ๋žœ์žญ์…˜์„ broadcastํ•จ
5. ์ด๋ฅผ ์ˆ˜์‹ ํ•œ ๋‹ค๋ฅธ ๋…ธ๋“œ๋“ค์€ ํŠธ๋žœ์žญ์…˜์„ ๋ณธ์ธ๋“ค์˜ local mempool์— ์ถ”๊ฐ€&broadcast
โ†’ ์ด ๊ณผ์ •์—์„œ ์–ด๋– ํ•œ user๋Š” broadcasting์„ ํ•˜๋Š” ๊ฒƒ ๋ณด๋‹ค๋Š” Flashbot Auction์— ์ „๋‹ฌํ•จ.
โ†’ ์ด๋ฅผ ํ†ตํ•ด MEV๋ฅผ ํ•  ์ˆ˜ ์žˆ์Œ
โ†’ ์ถ”๊ฐ€์ •๋ณด: [์ด๋”๋ฆฌ์›€-MEV](https://ethereum.org/en/developers/docs/mev/#mev-extraction)

โ†’ ์ด ๊ณผ์ •์—์„œ ์–ด๋– ํ•œ user๋Š” broadcasting์„ ํ•˜๋Š” ๊ฒƒ ๋ณด๋‹ค๋Š” Flashbot Auction์— ์ „๋‹ฌํ•จ.

โ†’ ์ด๋ฅผ ํ†ตํ•ด MEV๋ฅผ ํ•  ์ˆ˜ ์žˆ์Œ

โ†’ ์ถ”๊ฐ€์ •๋ณด: [์ด๋”๋ฆฌ์›€-MEV](https://ethereum.org/en/developers/docs/mev/#mev-extraction)

6. ๊ฐ slot์—์„œ๋Š” RANDAO ํ”„๋กœํ† ์ฝœ์„ ํ†ตํ•ด pseudo-randomํ•˜๊ฒŒ block proposer๊ฐ€ ์„ ์ถœ๋˜๊ฒŒ ๋œ๋‹ค
โ†’ ์ด block proposer๋Š” ๋‹ค์Œ์— ์ƒ์„ฑ๋  ๋ธ”๋ก์„ ๋งŒ๋“ค๊ณ , ์ด๋”๋ฆฌ์›€ ๋ธ”๋ก์ฒด์ธ์— broadcastingํ•˜๋ฉฐ, global state๋ฅผ ๋ณ€๊ฒฝ์‹œํ‚ค๋Š” ์—ญํ• ์„ ๋งก๋Š”๋‹ค.

โ†’ ์ด block proposer๋Š” ๋‹ค์Œ์— ์ƒ์„ฑ๋  ๋ธ”๋ก์„ ๋งŒ๋“ค๊ณ , ์ด๋”๋ฆฌ์›€ ๋ธ”๋ก์ฒด์ธ์— broadcastingํ•˜๋ฉฐ, global state๋ฅผ ๋ณ€๊ฒฝ์‹œํ‚ค๋Š” ์—ญํ• ์„ ๋งก๋Š”๋‹ค.

7. block proposer๋Š” ์œ„์—์„œ๋„ ์–ธ๊ธ‰๋˜์—ˆ๋˜ execution client์—์„œ, local mempool์— ์žˆ๋Š” ํŠธ๋žœ์žญ์…˜๋“ค์„ โ€œexecution payloadโ€์˜ ํ˜•ํƒœ๋กœ ๋ฌถ๊ณ , ์ด๋ฅผ locally executeํ•˜์—ฌ state change๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.
8. ์ด ์ •๋ณด๋Š” consensus client๋กœ ๋„˜์–ด๊ฐ€๊ฒŒ ๋˜๋Š”๋ฐ, ๊ฑฐ๊ธฐ์—์„œ๋Š” execution payload, reward, penalties, slashings, attestation ๋“ฑ ์— ๋Œ€ํ•œ ์ •๋ณด๊ฐ€ โ€œbeacon blockโ€์˜ ํ˜•ํƒœ๋กœ ๋ฌถ์ด๊ฒŒ ๋œ๋‹ค.
โ†’ ์ถ”๊ฐ€์ ์ธ ์ •๋ณด: [์ด๋”๋ฆฌ์›€-client๊ฐ„ ์—ฐ๊ฒฐ](https://ethereum.org/en/developers/docs/networking-layer/#connecting-clients)

โ†’ ์ถ”๊ฐ€์ ์ธ ์ •๋ณด: [์ด๋”๋ฆฌ์›€-client๊ฐ„ ์—ฐ๊ฒฐ](https://ethereum.org/en/developers/docs/networking-layer/#connecting-clients)

9. ๋‹ค๋ฅธ ๋…ธ๋“œ๋“ค์€ consensus layer gossip network์—์„œ ์ƒˆ๋กœ์šด beacon block์„ ์ˆ˜์‹ ํ•˜์—ฌ ์ด๋ฅผ ๊ทธ๋“ค์˜ execution client๋กœ ๋„˜๊ฒจ์ฃผ๊ฒŒ ๋œ๋‹ค.
โ†’ execution client์—์„œ๋Š” execution payload๊ฐ€ locally execute๋˜์–ด proposed state change๊ฐ€ ํƒ€๋‹นํ•œ์ง€์— ๋Œ€ํ•œ ๊ฒ€์‚ฌ๋ฅผ ์ง„ํ–‰ํ•˜๊ฒŒ ๋œ๋‹ค.

โ†’ execution client์—์„œ๋Š” execution payload๊ฐ€ locally execute๋˜์–ด proposed state change๊ฐ€ ํƒ€๋‹นํ•œ์ง€์— ๋Œ€ํ•œ ๊ฒ€์‚ฌ๋ฅผ ์ง„ํ–‰ํ•˜๊ฒŒ ๋œ๋‹ค.

10. node์˜ validator client๋Š” ์ฒด์ธ์— ๋Œ€ํ•œ ์ž์‹ ์˜ ๊ด€์ (local state)์—์„œ ๋ธ”๋ก์ด ์œ ํšจํ•จ์„ ์ฆ์–ธ(attest)ํ•˜๋Š” ๋ฉ”์‹œ์ง€๋ฅผ ๋ธŒ๋กœ๋“œ์บ์ŠคํŠธํ•œ๋‹ค.

โ†’ ์ด๋ฅผ ํ†ตํ•ด block์€ ๊ฐ ๋…ธ๋“œ์˜ ๋กœ์ปฌ ๋ธ”๋ก์ฒด์ธ์— ์ถ”๊ฐ€๋œ๋‹ค.


# Finality

Expand All @@ -78,15 +77,16 @@ ETH๋ฅผ depositํ•˜๋ฉด, user ๋Š” ์ƒˆ๋กœ์šด validator๊ฐ€ ๋„คํŠธ์›Œํฌ์— ๋“ค์–ด์˜ค

์ด๋ฏธ Finalize๋œ block์„ Revertํ•˜๊ฒŒ ๋œ๋‹ค๋ฉด, ๊ณต๊ฒฉ์ž๋Š” Stake๋˜์–ด์žˆ๋Š” ETH์˜ ์ตœ์†Œ 1/3 ์ด์ƒ์„ ์žƒ๊ฒŒ๋  ์ˆ˜ ์žˆ๋‹ค.

์ด์œ  โ†’ [์ด๋”๋ฆฌ์›€ ๊ณต์‹ ๋ธ”๋กœ๊ทธ](https://blog.ethereum.org/2016/05/09/on-settlement-finality/ )
์ด์œ  โ†’ [์ด๋”๋ฆฌ์›€ ๊ณต์‹ ๋ธ”๋กœ๊ทธ](https://blog.ethereum.org/2016/05/09/on-settlement-finality/)

๊ทธ๋ฆฌ๊ณ , ๊ณต๊ฒฉ์ž๋Š” 1/3 ์ด์ƒ์˜ Stake ETH๋ฅผ ๋งค์ˆ˜ํ•˜์—ฌ ๋„คํŠธ์›Œํฌ๊ฐ€ ๋ธ”๋ก์„ Finalize์‹œํ‚ค์ง€ ๋ชปํ•˜๋„๋ก ํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ(2/3์ด์ƒ ํˆฌํ‘œ๋ฅผ ํ•  ์ˆ˜ ์—†๊ฒŒ ํ•˜๋Š” ๋ฐฉ์‹), Ethereum์—์„œ๋Š” โ€œInactivity Leakโ€์ด๋ผ๋Š” ๋ฐฉ๋ฒ•์„ ํ†ตํ•ด ์ด๋ฅผ ๋ง‰์„ ์ˆ˜ ์žˆ๋‹ค. ์ด๋Š”, 4 ์—ํญ๋™์•ˆ block์ด Finalize๋˜์ง€ ์•Š๋Š”๋‹ค๋ฉด, ๊ณผ๋ฐ˜์ˆ˜ ํˆฌํ‘œ์— ๋ฐ˜๋Œ€ํ‘œ๋ฅผ ๋˜์ง„ Validator์˜ Stake๋œ ETH๋ฅผ ์Šฌ๋ž˜์‹ฑํ•˜์—ฌ ๋‹ค์‹œ ๊ฑด์ „ํ•œ Validator๋“ค๋กœ 2/3 ๊ณผ๋ฐ˜์ˆ˜๋ฅผ ๋ณต๊ตฌํ•ด๋‚ผ ์ˆ˜ ์žˆ๋‹ค.

# Fork Choice Rule

๋ชจ๋“  ๋„คํŠธ์›Œํฌ๊ฐ€ ๊ฑด์ „, ์ •์งํ•˜๊ฒŒ ์ž‘๋™ํ•œ๋‹ค๋ฉด, ๋ชจ๋“  ๋ธ”๋ก์˜ ๋’ค์— ์ถ”๊ฐ€๋˜๋Š” ๋ธ”๋ก์€ fork์—†์ด ๋‹จ ํ•œ ๊ฐœ์˜ ๋ธ”๋ก๋งŒ ์ƒ์„ฑ๋  ๊ฒƒ์ด๋‹ค. ๊ทธ๋Ÿฌ๋‚˜, Validator๋“ค์€ ๋„คํŠธ์›Œํฌ ์ง€์—ฐ์˜ ์ด์œ ๋กœ ์ธํ•ด ์„œ๋กœ ๋‹ค๋ฅธ ๊ด€์ (view)๋ฅผ ๊ฐ€์ง€๊ฒŒ ๋  ์ˆ˜ ์žˆ๋‹ค. ์ด๋ ‡๊ฒŒ ๋˜๋ฉด, consensus client๋“ค์€ ์–ด๋Š ๋ธ”๋ก์„ ์ง€์ง€, ๋˜๋Š” ์„ ํ˜ธํ•˜๋Š”์ง€์— ๋Œ€ํ•œ ํ•ฉ์˜๋ฅผ ์ด๋ฃจ์–ด์•ผ ํ•œ๋‹ค. Ethereum PoS์—์„œ๋Š” ์ด๋ฅผ LMD-GHOST๋ฅผ ์ด์šฉํ•ด ํ•ด๊ฒฐํ•˜๊ณ ์ž ํ•˜๋ฉฐ, ์ด๋Š” ๊ฐ€์žฅ ๋งŽ์€ ๊ฐ€์ค‘์น˜๋ฅผ ํ• ๋‹น๋ฐ›์€ Fork๋ฅผ ์ธ์ •ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ Fork Choice๋ฅผ ํ•œ๋‹ค.

### Gasper, Casper, LMD-GHOST์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ์„ค๋ช…


# ์ฐธ๊ณ ๋ฌธํ—Œ
[์ด๋”๋ฆฌ์›€ ๊ณต์‹ ๋ธ”๋กœ๊ทธ](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/)

[์ด๋”๋ฆฌ์›€ ๊ณต์‹ ๋ธ”๋กœ๊ทธ](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/)
12 changes: 8 additions & 4 deletions concepts/Misc/Mixer.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Mixer
# Mixer

(a Bitcoin mixer, a cryptocurrency tumbler) - a tool that allows users to mix their cryptocurrency funds with those of other users to obscure the source and destination of the funds - a coin mixer takes a user'sย **cryptocurrency**ย and mixes it with the cryptocurrency of other users. It creates a jumbled and untraceable pool of funds. This process aims to enhance the anonymity and privacy of the user's cryptocurrency transactions

Mixer์—๋Š” Centralized Mixer์™€ Decentralized Mixer๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
Mixer์—๋Š” Centralized Mixer์™€ Decentralized Mixer๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

## Centralized Mixer

Centralized Mixer๋Š” Mixing์„œ๋น„์Šค๋ฅผ ์ œ๊ณตํ•˜๋Š” ์ค‘์•™ํ™”๋œ ์—…์ฒด์—์„œ Mixing์„ ํ•ด์ฃผ๋Š” ๊ฒƒ์„ ๋งํ•ฉ๋‹ˆ๋‹ค.
์ค‘์•™ํ™”๋œ Mixer๋Š” ์•Œ๋ ค์ง€์ง€ ์•Š์€ account๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ์ด ์ด์šฉ์ž์˜ ์ž์‚ฐ์„ ์ด์ฒด๋ฐ›๊ณ , ๋‹ค๋ฅธ account์—์„œ ์ด์šฉ์ž์˜ ๋˜ ๋‹ค๋ฅธ account(์•Œ๋ ค์ง€์ง€ ์•Š์Œ)์œผ๋กœ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œํ•œ ๊ธˆ์•ก์„ ์ด์ฒดํ•˜๋Š” ์„œ๋น„์Šค์ž…๋‹ˆ๋‹ค.
## Decentralized Mixer (a.k.a CoinJoin)
์ค‘์•™ํ™”๋œ Mixer๋Š” ์•Œ๋ ค์ง€์ง€ ์•Š์€ account๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ์ด ์ด์šฉ์ž์˜ ์ž์‚ฐ์„ ์ด์ฒด๋ฐ›๊ณ , ๋‹ค๋ฅธ account์—์„œ ์ด์šฉ์ž์˜ ๋˜ ๋‹ค๋ฅธ account(์•Œ๋ ค์ง€์ง€ ์•Š์Œ)์œผ๋กœ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œํ•œ ๊ธˆ์•ก์„ ์ด์ฒดํ•˜๋Š” ์„œ๋น„์Šค์ž…๋‹ˆ๋‹ค.

## Decentralized Mixer (a.k.a CoinJoin)

### ์ฐธ๊ณ ์ž๋ฃŒ

[https://www.okx.com/learn/what-is-coin-mixer](https://www.okx.com/learn/what-is-coin-mixer)

0 comments on commit 9b33cbe

Please sign in to comment.