본 발표자료에서는 이더리움 플랫폼의 상세 아키텍쳐와 기반 기술, 그리고 스마트 컨트랙과 이를 기반한 Dapp의 개발 방안에 대해 소개한다. 이더리움은 블록체인 기반 기술하에 암호 화폐의 생성 , 전송 등 라이프사이클 관리외에 스마트 컨트랙을 지원한다. 스마트컨트랙은 서로 모르는 당사자간의 계약을 준수하도록 강제할 수 있는 응용 프로그램이다. 컨트랙 프로그램은 바이트코드로 컴파일된 후 블록체인을 통해 배포되고 , 로컬 로드상에서 실행되는 일종의 에이전트라 볼 수 있다. 이렇게 개바된 스마트컨트랙은 기존 웹 인터페이스를 통해 접근하고 활용할 수 있으며 이렇게 스마트 컨트랙 기반하에 개발된 응용 서비스를 Dapp이라 한다.
Getting Started in Blockchain Security and Smart Contract AuditingBeau Bullock
Why is blockchain security important?
Blockchain usage has exploded since the Bitcoin whitepaper was first published in 2008. Many applications rely on this technology for increased trust and privacy, where they would otherwise be absent from a centralized system.
The ecosystem surrounding blockchain technology is large, complex, and has many moving pieces. Exchanges exist where users can transact various cryptocurrencies, NFTs, and tokens. Smart contracts can be written to programmatically apply behavior to blockchain transactions. Decentralized Finance (DeFi) markets exist where users can swap tokens without needing to sign up for an account.
All of these pieces are prone to vulnerabilities, and with blockchain being at the forefront of emerging technology new issues are being found daily.
In this Black Hills Information Security (BHIS) webcast, we'll use case studies about recent blockchain hacks to introduce the underlying issues that occur in writing/engineering smart contracts that have ultimately lead to the loss of millions of dollars to attackers.
본 발표자료에서는 이더리움 플랫폼의 상세 아키텍쳐와 기반 기술, 그리고 스마트 컨트랙과 이를 기반한 Dapp의 개발 방안에 대해 소개한다. 이더리움은 블록체인 기반 기술하에 암호 화폐의 생성 , 전송 등 라이프사이클 관리외에 스마트 컨트랙을 지원한다. 스마트컨트랙은 서로 모르는 당사자간의 계약을 준수하도록 강제할 수 있는 응용 프로그램이다. 컨트랙 프로그램은 바이트코드로 컴파일된 후 블록체인을 통해 배포되고 , 로컬 로드상에서 실행되는 일종의 에이전트라 볼 수 있다. 이렇게 개바된 스마트컨트랙은 기존 웹 인터페이스를 통해 접근하고 활용할 수 있으며 이렇게 스마트 컨트랙 기반하에 개발된 응용 서비스를 Dapp이라 한다.
Getting Started in Blockchain Security and Smart Contract AuditingBeau Bullock
Why is blockchain security important?
Blockchain usage has exploded since the Bitcoin whitepaper was first published in 2008. Many applications rely on this technology for increased trust and privacy, where they would otherwise be absent from a centralized system.
The ecosystem surrounding blockchain technology is large, complex, and has many moving pieces. Exchanges exist where users can transact various cryptocurrencies, NFTs, and tokens. Smart contracts can be written to programmatically apply behavior to blockchain transactions. Decentralized Finance (DeFi) markets exist where users can swap tokens without needing to sign up for an account.
All of these pieces are prone to vulnerabilities, and with blockchain being at the forefront of emerging technology new issues are being found daily.
In this Black Hills Information Security (BHIS) webcast, we'll use case studies about recent blockchain hacks to introduce the underlying issues that occur in writing/engineering smart contracts that have ultimately lead to the loss of millions of dollars to attackers.
Demystifying the Distributed Database Landscape (DevOps) (1).pdfScyllaDB
What is the state of high-performance, distributed databases as we head deeper into 2022, and which options are best suited for your own development projects?
The data-intensive applications leading this next tech cycle are typically powered by multiple types of databases and data stores—each satisfying specific needs and often interacting with a broader data ecosystem. Even the very notion of a database is evolving as new hardware architectures and methodologies allow for ever-greater capabilities and expectations for horizontal and vertical scalability, performance and reliability.
In this webinar, Peter Corless, ScyllaDB’s director of technology advocacy, will survey the current landscape of distributed database systems and highlight new directions in the industry.
This talk will cover different database and database-adjacent technologies as well as describe their appropriate use cases, patterns and anti-patterns with a focus on:
- Distributed SQL, NewSQL and NoSQL
- In-memory datastores and caches
- Streaming technologies with persistent data storage
Optimizing Kubernetes Resource Requests/Limits for Cost-Efficiency and Latenc...Henning Jacobs
Kubernetes has the concept of resource requests and limits. Pods get scheduled on the nodes based on their requests and optionally limited in how much of the resource they can consume. Understanding and optimizing resource requests/limits is crucial both for reducing resource "slack" and ensuring application performance/low-latency. This talk shows our approach to monitoring and optimizing Kubernetes resources for 80+ clusters to achieve cost-efficiency and reducing impact for latency-critical applications. All shown tools are Open Source and can be applied to most Kubernetes deployments.
A Look into the Mirror: Patterns and Best Practices for MirrorMaker2 | Cliff ...HostedbyConfluent
From migrations between Apache Kafka clusters to multi-region deployments across datacenters, the introduction of MirrorMaker2 has expanded the possibilities for Apache Kafka deployments and use cases. In this session you will learn about patterns, best practices, and learnings compiled from running MirrorMaker2 in production at every scale.
Continguous Memory Allocator in the Linux KernelKernel TLV
Agenda:
Continguous Memory Allocator - how to allocate large continguous memory for large scale DMA in the kernel.
Speaker:
Mark Veltzer - CTO of Hinbit and a senior instructor at John Bryce. Mark is also a member of the Free Source Foundation and contributes to many free projects.
Most of the time, We forget that GC exists because it handles memory on its own. But, unfortunately, it is often involved in production incidents. This is at that moment it reminds you it exists and not everything is magic! Moreover, OpenJDK brings a handful of GCs with different characteristics and the default one (well not always...) is not the easiest to understand.
Though, this choice of GCs allows the JVM to adapt to different workloads and applications in terms of latency or throughput. I will explain how to tame those beasts and how to take advantage of them to improve your applications and resources.
"개발자가 설명하는 블록체인" 세미나
일자: 2018년 3월 10일 토요일
시간: 19시~22시 (총 3시간)
참가비: 1인당 2만 원
장소: 대전 둔산동 윙스터디
주관 및 주최: Team. Kojal
세미나 구성:
- 18:30~19시(30분) 접수
- 19~21시(2시간) 강의
- 21~22시(1시간) 질의응답 및 자유토론
강의 구성:
1. 블록체인의 근본과 핵심: Probabilistic State Machine
2. 합의(Consensus) 알고리즘: Proof Of Work를 중심으로
3. 블록체인을 적용한 프로젝트들: 비트코인, 이더리움, 리플 등 비교
강사: 김태균
- 현 대전 SBS 아카데미 컴퓨터아트학원 프로그래밍 강사
- Team. Kojal 공동대표
- 프리렌서
세미나 참가를 위한 조건:
- 일반적인 데이터베이스를 활용한 어플리케이션 개발 경험이 있어야 합니다.
- 적어도 위와 같은 경험이 있다는 가정하에 모든 설명이 시작됩니다.
- 물론 그렇지 않더라고 참여하는 것은 자유입니다.
강의 내용 설명:
- 개발자의 입장으로 블록체인에 관해서 설명합니다.
- 블록체인이 무엇이고 무엇을 해결하고자 나온 문제인지 기술적인 관점에서 설명합니다.
- 채굴(Mining)이 무엇이고 왜 그러한 과정이 필요로 하는지에 대해서 설명합니다.
- '어려운 수학 문제를 풀기 위해경쟁한다.'의 의미를 명확하게 기술적으로 설명합니다.
- 현재 나와 있는 블록체인 기반 기술에 대해서 몇 가지를 뽑아서 알아보고 비교해봅니다.
강의 전 주의 사항:
- 비트코인을 중심으로 블록체인을 설명하고, 합의 알고리즘은 POW를 중심으로 다룹니다.
- 너무 깊은 주제까지는 다루지 않습니다. 블록체인을 이해하고자 하시는 분들을 위한 세미나입니다.
Communication between Microservices is inherently unreliable. These integration points may produce cascading failures, slow responses, service outages. We will walk through stability patterns like timeouts, circuit breaker, bulkheads and discuss how they improve stability of Microservices.
2022년 11월 30일 코엑스에서 개최한 베스트콘2022(Better Software Testing Conference 2022)에서 발표한 강연 자료입니다.
대규모 장애를 막기 위해 소프트웨어/품질 엔지니어가 알아야 할 내결함성의 개념과 설계 기법을 공유드립니다.
생생한 강연 영상으로 확인해 보세요!
https://youtu.be/OLsv7oG0VPo
Optimizing Network Performance for Amazon EC2 Instances (CMP308-R1) - AWS re:...Amazon Web Services
Many customers are using Amazon EC2 instances to run applications with high performance networking requirements. In this session, we provide an overview of Amazon EC2 network performance features— including enhanced networking, ENA, and placement groups—and discuss how we are innovating on behalf of our customers to improve networking performance in a scalable and cost-efficient manner. We share best practices and performance tips for getting the best networking performance out of your Amazon EC2 instances.
Demystifying the Distributed Database Landscape (DevOps) (1).pdfScyllaDB
What is the state of high-performance, distributed databases as we head deeper into 2022, and which options are best suited for your own development projects?
The data-intensive applications leading this next tech cycle are typically powered by multiple types of databases and data stores—each satisfying specific needs and often interacting with a broader data ecosystem. Even the very notion of a database is evolving as new hardware architectures and methodologies allow for ever-greater capabilities and expectations for horizontal and vertical scalability, performance and reliability.
In this webinar, Peter Corless, ScyllaDB’s director of technology advocacy, will survey the current landscape of distributed database systems and highlight new directions in the industry.
This talk will cover different database and database-adjacent technologies as well as describe their appropriate use cases, patterns and anti-patterns with a focus on:
- Distributed SQL, NewSQL and NoSQL
- In-memory datastores and caches
- Streaming technologies with persistent data storage
Optimizing Kubernetes Resource Requests/Limits for Cost-Efficiency and Latenc...Henning Jacobs
Kubernetes has the concept of resource requests and limits. Pods get scheduled on the nodes based on their requests and optionally limited in how much of the resource they can consume. Understanding and optimizing resource requests/limits is crucial both for reducing resource "slack" and ensuring application performance/low-latency. This talk shows our approach to monitoring and optimizing Kubernetes resources for 80+ clusters to achieve cost-efficiency and reducing impact for latency-critical applications. All shown tools are Open Source and can be applied to most Kubernetes deployments.
A Look into the Mirror: Patterns and Best Practices for MirrorMaker2 | Cliff ...HostedbyConfluent
From migrations between Apache Kafka clusters to multi-region deployments across datacenters, the introduction of MirrorMaker2 has expanded the possibilities for Apache Kafka deployments and use cases. In this session you will learn about patterns, best practices, and learnings compiled from running MirrorMaker2 in production at every scale.
Continguous Memory Allocator in the Linux KernelKernel TLV
Agenda:
Continguous Memory Allocator - how to allocate large continguous memory for large scale DMA in the kernel.
Speaker:
Mark Veltzer - CTO of Hinbit and a senior instructor at John Bryce. Mark is also a member of the Free Source Foundation and contributes to many free projects.
Most of the time, We forget that GC exists because it handles memory on its own. But, unfortunately, it is often involved in production incidents. This is at that moment it reminds you it exists and not everything is magic! Moreover, OpenJDK brings a handful of GCs with different characteristics and the default one (well not always...) is not the easiest to understand.
Though, this choice of GCs allows the JVM to adapt to different workloads and applications in terms of latency or throughput. I will explain how to tame those beasts and how to take advantage of them to improve your applications and resources.
"개발자가 설명하는 블록체인" 세미나
일자: 2018년 3월 10일 토요일
시간: 19시~22시 (총 3시간)
참가비: 1인당 2만 원
장소: 대전 둔산동 윙스터디
주관 및 주최: Team. Kojal
세미나 구성:
- 18:30~19시(30분) 접수
- 19~21시(2시간) 강의
- 21~22시(1시간) 질의응답 및 자유토론
강의 구성:
1. 블록체인의 근본과 핵심: Probabilistic State Machine
2. 합의(Consensus) 알고리즘: Proof Of Work를 중심으로
3. 블록체인을 적용한 프로젝트들: 비트코인, 이더리움, 리플 등 비교
강사: 김태균
- 현 대전 SBS 아카데미 컴퓨터아트학원 프로그래밍 강사
- Team. Kojal 공동대표
- 프리렌서
세미나 참가를 위한 조건:
- 일반적인 데이터베이스를 활용한 어플리케이션 개발 경험이 있어야 합니다.
- 적어도 위와 같은 경험이 있다는 가정하에 모든 설명이 시작됩니다.
- 물론 그렇지 않더라고 참여하는 것은 자유입니다.
강의 내용 설명:
- 개발자의 입장으로 블록체인에 관해서 설명합니다.
- 블록체인이 무엇이고 무엇을 해결하고자 나온 문제인지 기술적인 관점에서 설명합니다.
- 채굴(Mining)이 무엇이고 왜 그러한 과정이 필요로 하는지에 대해서 설명합니다.
- '어려운 수학 문제를 풀기 위해경쟁한다.'의 의미를 명확하게 기술적으로 설명합니다.
- 현재 나와 있는 블록체인 기반 기술에 대해서 몇 가지를 뽑아서 알아보고 비교해봅니다.
강의 전 주의 사항:
- 비트코인을 중심으로 블록체인을 설명하고, 합의 알고리즘은 POW를 중심으로 다룹니다.
- 너무 깊은 주제까지는 다루지 않습니다. 블록체인을 이해하고자 하시는 분들을 위한 세미나입니다.
Communication between Microservices is inherently unreliable. These integration points may produce cascading failures, slow responses, service outages. We will walk through stability patterns like timeouts, circuit breaker, bulkheads and discuss how they improve stability of Microservices.
2022년 11월 30일 코엑스에서 개최한 베스트콘2022(Better Software Testing Conference 2022)에서 발표한 강연 자료입니다.
대규모 장애를 막기 위해 소프트웨어/품질 엔지니어가 알아야 할 내결함성의 개념과 설계 기법을 공유드립니다.
생생한 강연 영상으로 확인해 보세요!
https://youtu.be/OLsv7oG0VPo
Optimizing Network Performance for Amazon EC2 Instances (CMP308-R1) - AWS re:...Amazon Web Services
Many customers are using Amazon EC2 instances to run applications with high performance networking requirements. In this session, we provide an overview of Amazon EC2 network performance features— including enhanced networking, ENA, and placement groups—and discuss how we are innovating on behalf of our customers to improve networking performance in a scalable and cost-efficient manner. We share best practices and performance tips for getting the best networking performance out of your Amazon EC2 instances.
예제로 배우는 이더리움 결제구현 (거래소 지갑 구현 예시)Colin Chae
대상
- 이더리움이 어떻게 돌아가는지 알고 싶은 분들
- 이더리움 입출금 개발을 시작하시려는 분들
- Go-ethereum 소스코드 공부하시는 분들
개발스택
- 이더리움 노드 : 설치/운영 수고가 없는 infura.io 사용
- 개발 언어 + 라이브러리 : Go + Geth (as a RPC library)
AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018Amazon Web Services Korea
AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기
AWS에서 다양한 Blockchain Network를 직접 구축하고 배포하는 전체 과정을 설 AWS Kubernetes 서비스 자세히 살펴보기 명합니다. 이더리움 PoW, PoA, 텐더민트와 같은 다양한 메인넷을 AWS구동하고 Kubernetes와 CloudFormation으로 블록체인을 배포하는 방법을 시연합니다.
가상화폐와 블록체인 기술 Cryptocurrency & Blockchain Technology (KOR ver.)경록 박
한국거래소 시장감시시스템팀 박경록 사원이 제작한 블록체인 기술에 대한 정리 자료. 사토시 나카모토의 비트코인 논문에 기반하여 블록체인 기술의 원리에 대해 설명. 주요 코인의 특징과 기술, 세계 코인 시장의 상황, 블록체인의 미래를 논함. 한국거래소 KRX에서의 블록체인 활용법을 탐색.
Summary of 'blockchain technology' by Kyung-rok Park, assistant manager of KRX(Korea Exchange) market surveillance team.
Explains the principle of blockchain technology based on Satoshinamoto's Bitcoin thesis.
Discuss the characteristics and technology of major coins, the situation of the world coin market, and the future of the blockchain.
Explore the usage of the block chain in the KRX.
Written in Korean.
Email : jarvis@krx.co.kr
시중에 돌아 다니는 블록체인에 대한 다양한 정보들이 내용의 깊이가 다르고, 의미가 지나치게 추상적이고 단편적인 것들이 많아 오해가 생기는 경우도 있는 것 같습니다. 블록체인에 대해 학습을 시작하면서 어려운 점이 많았고, 심지어 블록체인 = 비트코인, 또는 블록체인 = 인증시스템... 이런 식의 잘 못된 정의들이 있어서 학습하는 데 어려움이 많았습니다. 이 문서는 당초 함께 공부하는 스터디 그룹 멤버들과 공유하고자 약 3주간의 자료조사와 학습을 한 후에 정리하는 차원에서 작성된 것입니다. 블록체인의 정의, 구성요소, 작동원리 등에 관한 내용이며, 블록체인에 관심이 있는 분들에게 미약하나마 도움이 될까 하여 공유합니다.
제가 도움을 받은 자료들에 대한 출처는 맨 마지막 페이지에 넣었습니다.
블록체인을 어떻게 공부해야 할까, 블록체인을 공부하면서 만나게 될 개념들은 뭘까 미리 맛보기로 보고 간다고 생각하시면 됩니다!
(아쉽게도 여기서는 블록체인을 왜 공부해야 하는지에 대한 이유나 '탈중앙화 데이터베이스'라는 블록체인의 근본적인 백그라운드는 건너뛰고 시작합니다.)
비트코인과 이더리움을 중점으로 요즘 핫한 블록체인 응용 예시들을 가지고 설명하다보니 다소 어려운 점들이 있을 수도 있습니다. 이 내용이 이해가 안 가신다고 좌절하지 마시고, 앞으로 공부하면서 이런 것들을 보겠구나 하고 넘어가시면 됩니다.
정말 0에서 시작하는 분들에게는 다소 어려울 수도 있는 점 양해 부탁드립니다. 다음에는 더 쉽게~ 풀어서 찾아뵐게요.
Similar to 세션2. 이더리움 합의 알고리즘과 마이닝 (20)
Hidden 서비스 소개 - 티스테이지강연(201061125 )Jay JH Park
필요할 때에 임시직을 섭외해 일을 맡기는 경제 형태를 Gig Economy 라고 한다. 미 대통령 후보인 클린턴의 그의 경제정책 발표에서 이렇게 말했다. "많은 미국인들은 남는 방을 빌려주거나, 웹사이트를 디자인하거나, 자신의 차를 운전함으로써 돈을 더 벌고 있다. Gig Economy라고 불리우는 경제가 활발한 기회와 혁신을 만들어 내고 있다. Uber, Lyft, Thumbtack, Verlocal 등 많은 업체들이 Gig Economy , 개인이 갖고 있는 자산이나 시간, 기술을 자유롭게 공유하고 매매하는 시장을 만들어 가고 있다. 4차 산업 혁명, 100세 시대, 1인 가구, 1인 창업, 주 4일 근무, 인공 지능 등 우리의 주변 환경 변화는 우리의 자아 실현을 위한 욕구를 더욱 강하게 만들고 있고 평생 직장이 아니라 평생 직업을 준비하도록 강요하고 있다. 자아실현을 하며 다르게 살 수 있는 기회. 이러한 것을 가능하게 해주는 플랫폼을 만들고 싶었다. 덕후,오따구,능력자들이 자유롭게 그 재능을 펼치고 다르게 살 수 있는 해주는 플랫폼, Hidden이다. Hidden을 티스테이지에서 소개한 자료.
필요할 때에 임시직을 섭외해 일을 맡기는 경제 형태를 Gig Economy 라고 한다. 미 대통령 후보인 클린턴의 그의 경제정책 발표에서 이렇게 말했다. "많은 미국인들은 남는 방을 빌려주거나, 웹사이트를 디자인하거나, 자신의 차를 운전함으로써 돈을 더 벌고 있다. Gig Economy라고 불리우는 경제가 활발한 기회와 혁신을 만들어 내고 있다. Uber, Lyft, Thumbtack, Verlocal 등 많은 업체들이 Gig Economy , 개인이 갖고 있는 자산이나 시간, 기술을 자유롭게 공유하고 매매하는 시장을 만들어 가고 있다. 4차 산업 혁명, 100세 시대, 1인 가구, 1인 창업, 주 4일 근무, 인공 지능 등 우리의 주변 환경 변화는 우리의 자아 실현을 위한 욕구를 더욱 강하게 만들고 있고 평생 직장이 아니라 평생 직업을 준비하도록 강요하고 있다. 자아실현을 하며 다르게 살 수 있는 기회. 이러한 것을 가능하게 해주는 플랫폼을 만들고 싶었다. 덕후,오따구,능력자들이 자유롭게 그 재능을 펼치고 다르게 살 수 있는 해주는 플랫폼, Hidden이다. Hidden에 대한 소개 자료.
3. 문제점1. 비잔티움 장군 문제
• 5명의 장군이 성을 공격하려면 성안의 병력보다 많은 병력이 공격해야 함
• 장군들은 연락병을 보내 소통 가능하나, 그 중에 배신자가 있어 서로 신뢰 불가함
1982년 레슬리 램포트등의 논문에서 처음 언급
ethereum 연구회
4. 문제점2. 이중 지불 문제
• 분산 디지털 화폐 시스템에서 토큰이 한번 이상 소비되는 문제
• 탈 중앙형 환경에서는 트랜잭션에 대한 Finalize를 결정하기 어려움
Authority
1 to B
1 to C
possible!
< 중앙 집중형 > < 탈 중앙형 >
Finalize!
Finalize?
A
B
C
1 ether
A
1 ether B
C
x
ethereum 연구회
5. 합의 알고리즘 계층이 왜 필요한가?
• P2P 네트웍에서는 처리된 블록이나 트랜잭션에 문제가 없는지를 확인해 주는 주체가 없기
때문에 참여자들은 서로 검토하고 동의하고, 유효성을 판단하는 절차가 필요
• 유효한 블록체인이 두개 존재할때 어떤것을 선택할지 규칙이 있어야 함
합의 방식 알고리즘 장점 단점 처리속도
PoW
(Proof of Work)
Ethash 검증됨 많은 에너지 사용 낮음
PoS
(Proof of Stake)
Casper 보다 효율적 검증 안됨 높음
합의 알고리즘을 통해 서로 신뢰할수 있는 규칙을 따르게 됨 (비잔티움장군 문제 해소)
ethereum 연구회
8. 블록 유효성 검증
① Difficulty가 제일 높은 블록을 선택
② 작업 증명(PoW)을 제대로 되었는지 확인 (Nonce로 검증)
③ 머클 패트리샤 트리 확인 (Merckle Status Transition proof)
④ 가스 사용량 비교 (gasUsed <= gasLimit 검사)
⑤ 블록 넘버, 트랜젝션 루트, Uncle 루트 검증 등
125 126
Confirmation!
124
Validation Check
새로운 블록체인이 연결하기 전 합의를 준수했는지 검증(Validation)후 Confirmation하는 과정
Regular Fork Case
125
126’
126124 127
Uncle block
검증(Validation)과정을 통해 확인된 블록을 Confirmation하고,
정규 블록이 아니거나, 잘못된 블록은 6 confirmation 까지 기다렸다가 최종 Reject한다.
125
126
126
124
동시에
① 동시에 블록에 등록될 때
② Winner Block이 못 되었을 때
ethereum 연구회
9. 6 Confirmations이 지나면 나누어진 블록에서 Canonical Block을 확정할 수 있다.
[참고] 6 Confirmation
A
B
C
1 ether waits for 6 confirmations
waits for 6 confirmations
Abandoned block
à Finalized!
à Rejected!
동시에
6 Confirmation을 기다리면 최종 Finalized하여 거래를 확정한다. (이중지불 문제 해소)
다음 블록이 이전 블록을 Confirm함
< 이중 지불 문제>
ethereum 연구회
10. PoW 알고리즘
작업증명을 통한 Block chain 구성
Block Header N
Time stamp
Prev Hash
Nonce
Merkle Root
Prev Hash
Nonce
Merkle Root
2^256
/
Transaction 1
Transaction 2
Transaction 3
Merkle Tree
Block Header N
Time stamp
Prev Hash
Nonce
Merkle Root
작거나 같으면
신규 Block 생성
크면
Nonce 재조정
Hash
Hash
Hash
Difficulty
00000xxxxxxx..
ethereum 연구회
11. [참고] Difficulty
* Difficulty 계산 공식 (비잔티움)
diff = (parent_diff +(parent_diff / 2048 *max((2 if len(parent.uncles) else 1) -
((timestamp - parent.timestamp) // 9), -99))) + 2^(periodCount - 2)
2^(periodCount - 2)의 의미?
: 난이도 폭탄, periodCount 는 인위적으로 마이닝 시간을 늘리기 위한 Fake 블록 수
비잔티움 하드포크
비잔티움 에서는 난이도 폭탄 값이 초기화
§ 블록 생성 주기가 짧아짐
§ 마이너 보상이 5에서 3이더로 조정
ethereum 연구회
12. 12초의 비밀
Q1. 뷰탈릭은 왜 10분을 12초로 줄였나?
블록 사이즈가 클수록 블록 인터벌이 적을수록
Stale Block(엉클블록) 이 많이 생긴다.
Block Size
Stale Rate
Transfer Time
ethereum 연구회
18. Ethash Mining Flow
Bitcoin 의 경우 단순히 SHA256 연산만을
필요로 하므로 일반 CPU, GPU 보다
수천배 이상 빠른 ASIC 제작이 가능
단순히 SHA256 연산만을 필요했던
Bitcoin 의 Mining 알고리즘과 달리
Ethash 에서는 DAG 를 통해
미리 알 수, 할 수 없는
순차적 메모리 연산을 요구하여,
ASIC 제작을 어렵게 함
ethereum 연구회
19. Ethash
• Memory Hard Computation
• Memory Easy Validation
• ASIC ( 주문형 반도체 ) 제작을 힘들게
• 위 같은 목적 달성을 위해 매 3만 블록마다 수 GB 의 DAG(Directed acyclic graph)를
새로 생성하여 해싱에 사용( 점점 사이즈 증가 )
• KECCAK(SHA-3) 사용
• Dagger 와 Hashimoto 알고리즘의 장점을 결합한 Dagger-Hashimoto 의 수정버전
ethereum 연구회
20. Ethash: DAG data, cache size
• 블록의 헤더들을 스캔하여 Seed 값 추출 가능
• 해당 Seed 를 통해 16MB 의 pseudo random cache 를 계산 가능
• 해당 Cache를 통해 1GB 이상의 Full Dataset 을 생성 가능
• 30,000 Block 단위 별로 Full Dataset 이 완전히 바뀌고, 선형으로 커지도록 설계 됨
• 해당 Full Dataset 의 랜덤한 부분을 마이닝 해싱 작업에 포함 시키도록 함
• 따라서 메모리 읽기 연산, Dataset 저장 공간 등의 제약을 주어
ASIC 제작이 불가능하도록 함
ethereum 연구회
21. Ethash: DAG Cache Generation
선형 증가하는 소수를 사이즈로 사용
2048 epoch 만큼의 lookup table 이 미리 계산되어 하드코딩 되어 있다.
2017.11 기준 약 450만 블록으로서, 약 150 epoch 이며 DAG 의 사이즈는
2.2GB 정도
https://github.com/ethereum/wiki/wiki/Ethash
22. Ethash: DAG Cache Generation
Sergio Demian Lerner 의 RandMemoHash Strict Memory Hard Hashing Functions (2014) 알고리즘을 사용하여
연산 시 메모리가 특정 임계치 보다 낮으면 연산 속도가 기하급수적으로 길어지도록 설계,
이를 통해 특정 시간동안 특정양의 메모리가 해당 연산을 위해서만 사용 되었음을 증명 할 수 있게된다.
https://github.com/ethereum/wiki/wiki/Ethash
# 3
# 64
# keccak512
ethereum 연구회
27. Ethash 정리
• 민주적, 비독점적인 탈중앙 마이닝을 위해 ASIC 제작을 어렵도록 설계
• ASIC 의 경우 오로지 마이닝 용도이므로 (전기료 == 채굴수입) 이 되어 에너지가 낭비됨
• Ethash 계속 확장, 변경되는 DAG 파일을 통한 메모리 연산을 요구함
• 따라서 별도 장비구입 없이 이미 모두가 소유하고있는 일반적인 PC 로 채굴하기 적합
• 하지만 합의 과정을 위해 불필요한 연산을 통한 에너지 소비는 여전하므로
장기적으로 PoS 가 불가피
ethereum 연구회
28. PoW 문제점
리소스 문제
GPU로 아무 의미(?) 없는 해시값을 찾아내야 하고, 그 작업을 위해 불필요한 리소스들
이 대거 투입되어 무의미한 에너지 소비가 증가하는 문제
엉클블록 문제
빨라지는 주기를 PoW의 Difficulty로 유지하는데는 한계가 있다. (12초 목표)
컴퓨팅 파워가 큰 마이너의 영향력이 커져 악의적으로 이용될 수 있는 우려
ethereum 연구회
29. Proof Of Stake (PoS; 지분증명)
- Validator (=virtual miner) 가 가진 지분(Stake)에 비례한 확률로 블록을 생성할 권한을
얻게 되고, 블록을 생성한 후 원하는 체인에 블록을 붙이고 보상을 얻는 방식
- 장점
- 에너지 비용 절감 (PoW와 같이 어려운 문제를 풀지 않아도 됨)
- 전기비가 들지 않기 때문에 많은 코인을 새로 발행할 필요가 없어짐
- 보안성 강화
- 중앙화 위험 감소
- PoW 에서는 대형 마이닝 풀 몇개가 공모하면 51% 공격도 가능
- PoS 에서도 대형 거래소 몇개가 공모하면 공격 가능하지만 폭락으로 인해 가능성 적음
- 과거 블록을 바꾸기 매우 힘들게 만듦 (finality 성질)
- 공격 하다 실패하면 모든 자산 → 0
ethereum 연구회
30. 기본 아이디어
1. 이더리움의 기본 화폐인 이더(Ether)를 Capser 스마트컨트랙트에 예치(Deposit)하면 Val
idator 가 된다 (한동안 이더가 묶임)
2. Validator 가 되면 새로운 블록을 정규 체인에 추가할지 여부를 투표 가능
(항상 가능한 것은 아니고 지분의 비율 대로 랜덤하게 권한이 부여됨)
3. Validator 가 규칙을 따르지 않으면 불이익을 얻는다
a. 잘못된 블록에 투표 하면 불이익
b. 투표를 안해도 불이익
ethereum 연구회
31. 초기 PoS 알고리즘의 문제 : Nothing-at-stake
2011년에 나온 PeerCoin 에서 처음 도입. 그런데 보상해주는 개념만 있어서 2개의 체인이 나
눠졌을 때 둘다 맞는 체인으로 투표 하면 더 큰 보상이 주어짐
ethereum 연구회
33. PoS 의 단계적 적용
내년 까지 점차 비율을 늘려 가며 PoW → PoS 적용
○ Checkpoint 라 불리는 매 100번째 block 마다 Finalize
■ 한번 Finalize 되면 되돌릴 수 없도록 하여 51% 공격, 이중지불 등을 방지
● 되돌리려면 여러 Validator 가 많은 돈을 소각해야 함
■ Finalize 를 위해 2/3 이상의 투표를 받아야 함
Block 1 Block 2
Block 1
00
…..
Block 1
01
…..
Finalize
(PoS)
PoWPoW PoW
ethereum 연구회
34. Capser 의 스마트 컨트랙
Viper 라는 실험적인 언어로 작성됨
- Solidity 대체 언어
- 파이썬과 유사
- 스마트컨트랙: simple_casper.v.py
ethereum 연구회
35. Casper Paper : overview
Casper 프로토콜 처음 공부하는 분이 읽기 좋은 논문
“Casper The Friendly Finality Gadget”
41. DAG Cache Generation
Sergio Demian Lerner 의 RandMemoHash
Strict Memory Hard Hashing Functions (2014)
알고리즘을 사용하여
연산 시 메모리가 특정 임계치 보다 낮으면
연산 속도가 기하급수적으로 길어지도록 설계,
이를 통해 특정 시간동안 특정양의 메모리가
해당 연산을 위해서만 사용 되었음을
증명 할 수 있게된다.
ethereum 연구회