Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
밑바닥부터 시작하는 비트코인
by
류정필
,
송재준
November 2019
Beginner to intermediate
408 pages
9h 29m
Korean
Hanbit Media, Inc.
Content preview from
밑바닥부터 시작하는 비트코인
11
장
단순 지급 검증
287
None
,
None
,
None
]
➊
매 레벨마다 노드의 수가 절반씩 줄어들기 때문에 단말 노드 수에
log
2
를 한 값이 가장 큰
머클트리 레벨 번호가 됩니다. 각 레벨에서 노드 수가
2
의 거듭제곱이 아닌 경우를 위해
math
.
ceil
함수로 반올림하여 정확한 레벨의 개수를 구합니다.
len
(
bin
(
total
))
-
2
로
구할 수도 있습니다.
➋
머클트리는 루트 레벨을
0
번 인덱스에 갖고 있고, 그 아래 레벨의 노드는
1
번 인덱스에,
그다음은
2
번 인덱스에 순차적으로 가지게 됩니다. 다시 말하면 인덱스는 위로부터 아래
로의 깊이입니다.
➌
총 레벨의 수는
0
번 레벨부터 시작하기 때문에
max
_
depth
에
1
을 더해야 합니다.
➍
현재 레벨에서의 노드 개수는 가장 높은 레벨에서 한 레벨씩 올라올 때마나 절반씩 줄어
들기 때문에 전체 노드의 수를 총 레벨의 수와 현재 레벨의 수의 차이
(
max
_
depth
-
depth
)
만큼
2
로 계속 나눈 값입니다. 레벨에서 노드의 개수가 홀수가 되는 경우에도 정확한 값을
구하기 위해
math
.
ceil
을 호출합니다.
➎
현재로서는 해시값을 모르므로
None
값으로 초기화합니다.
➏
여기서
merkle
_
tree
변수는 해시값 리스트의 리스트입니다. 즉
2
차원 배열로 머클트리를
표현했습니다.
연습문제
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
밑바닥부터 시작하는 딥러닝
사이토 고키
실리콘밸리 리더십
김정혜, 마이클 롭
마이크로서비스 아키텍처 구축(전면 개정판)
샘 뉴먼
머신러닝 시스템 설계
칩 후옌
Publisher Resources
ISBN: 9791162248294