Skip to Content
밑바닥부터 시작하는 비트코인
book

밑바닥부터 시작하는 비트코인

by 류정필, 송재준
November 2019
Beginner to intermediate
408 pages
9h 29m
Korean
Hanbit Media, Inc.
Content preview from 밑바닥부터 시작하는 비트코인
3
타원곡선 암호
117
>>> print(hex(s))
0xbb14e602ef9e3f872e25fad328466b34e6734b7a0fcd58b1eb635447ffae8cb9
이런 식으로 하면 비밀키를 쉽게 기억할 수 있습니다. 그렇지만 실제 비밀키는 이런 식으
로 생성하면 안 됩니다.
서명해시입니다. 또는 메시지 해시라고도 합니다.
여기서는 단순 예로서 고정된
k
를 사용했습니다.
kG
= (
r
,
y
)를 계산 후
x
좌표만 취합니다.
s
= (
z
+
re
)/
k
. 위수
n
의 순환군
cyclic
group
이기에
n
으로 나머지연산을 합니다.
검증자는 공개키에 해당하는
point
를 이미 알고 있다고 가정합니다.
연습문제
3.7
비밀키
e
로 메시지
z
의 서명을 구하시오.
e = 12345
z = int.from_bytes(hash256('Programming Bitcoin!'), 'big')
3.12.7
서명 생성 코딩하기
메시지에 대해 서명을 생성하기 위해서 비밀키를 보관할
PrivateKey
클래스를 다음과 같이 작
성합니다.
class PrivateKey:
def __init__(self, secret):
self.secret = secret
self.point = secret * G
def hex(self):
return '{:x}'.format ...
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