Mastering Bitcoin 2nd 읽기 온라인 세미나 4.Keys, Addresses

in #kr6 years ago

이번 장은 암호화 관련 부분이 많아서 암호화 관련 지식이 없이는 진도를 빼기도 어렵고, 진도를 빼더라도 제대로 이해하기가 어렵습니다. 진도도 빼고 암호화 부분도 제대로 이해하기 위해 이번 세미나는 다음과 같이 진행합니다.

암호화 관련 세부적인 사항은 추후 암호화에 대한 세미나를 진행하면서 다시 다루기로 하고, 이번 세미나에서는 모두 제외합니다. 암호화 관련 부분이 아니더라도 이해할 양이 많은 경우 다음으로 미룹니다.

Chapter 4. Keys, Addresses


Cryptography can also be used to prove knowledge of a secret without revealing that secret (digital signature), or prove the authenticity of data (digital fingerprint - called a bitcoin address).

위 문장이 와 닿을 때까지 10번 이상 읽고 써 봅시다. 특히 'prove knowledge of a secret without revealing that secret' 이 부분에 주의를 기울여서

Ownership of bitcoin is established through digital keys, bitcoin addresses, and digital signatures.
These digital keys are very rarely seen by the users of bitcoin. For the most part, they are stored inside the wallet file and managed by the bitcoin wallet software.

비트코인 소유권은 디지털 키, 비트코인 주소, 디지털 서명으로 성립됩니다.
디지털 키는 개인 키와 공개 키 한 쌍으로 구성됩니다. 이들 디지털 키가 비트코인 사용자들에게 직접적으로 노출될 일은 거의 없습니다. 대부분의 경우 지갑 파일 안에 저장되고, 비트코인 지갑 소프트웨어로 관리됩니다.

In the payment portion of a bitcoin transaction, the recipient’s public key is represented by its digital fingerprint, called a bitcoin address.
In most cases, a bitcoin address is generated from and corresponds to a public key. However, not all bitcoin addresses represent public keys; they can also represent other beneficiaries such as scripts.

비트코인 거래의 지불 부분에서 수취인의 공개 키는 비트코인 주소라 불리는 디지털 지문으로 표현됩니다. 지문으로 개인을 식별하듯이 비트코인 주소(디지털 지문)로 수취인을 식별하겠다는 것. 비트코인 주소는 대부분 공개 키로 생성하지만 모든 비트코인 주소가 공개 키를 나타내는 것은 아닙니다. 스크립트와 같은 것을 나타내기도 합니다.

This way, bitcoin addresses abstract the recipient of funds.
The bitcoin address is the only representation of the keys that users will routinely see, because this is the part they need to share with the world.

비트코인 주소는 자금의 수취인을 추상화합니다.
비트코인 주소는 비트코인 사용자들에게 공유되어 일상적으로 볼 수 있는 유일한 키 표현입니다.

In bitcoin, we use public key cryptography to create a key pair that controls access to bitcoin. The key pair consists of a private key and—derived from it—a unique public key. The public key is used to receive funds, and the private key is used to sign transactions to spend the funds.

비트코인에서는 공개키 암호법을 사용합니다.

Figure 4-1. Private key, public key, and bitcoin address

개인 키로 부터 타원곡선곱셈(elliptic curve multiplication)을 사용해서 공개 키를 생성하고, 공개 키로 부터 해시함수를 사용해서 비트코인 주소를 생성합니다. 타원곡선곱셈과 해시함수는 일방향 함수로 한 방향으로 계산하는 것은 쉽지만 반대 방향으로 계산하는 것은 거의 불가능합니다.

개인키는 무작위로 추출한 단순한 숫자입니다.

다음 명령으로 새 키를 생성합니다.
bitcoin-cli getnewaddress

생성된 키는 보안 이유로 공개 키만 보여집니다. 개인 키를 표시하려면 다음 명령을 실행합니다. Base58로 인코딩된 개인키를 제공합니다.
bitcoin-cli dumpprivkey <공개 키>

Key Formats
개인 키와 공개 키는 여러 다른 포맷으로 표현될 수 있습니다.

개인 키는 256비트의 숫자로, Raw, Hex, WIF, WIF-Compressed 포맷으로 표현될 수 있습니다. Raw나 Hexadecimal 포맷은 소프트웨어 내부에 주로 사용되고, WIF 포맷은 지갑들 사이에 키 가져오기나 내보내기할 때 사용하고, 종종 QR 코드에 사용합니다. WIF는 Base58Check 인코딩으로 접두어 5을 사용해서 키를 표현합니다.

공개 키는 타원곡선상에 존재하는 한 점으로 x좌표와 y좌표 값을 갖습니다. 좌표 값은 각각 256비트 숫자입니다. 공개 키를 표현할 때는 압축된 표현과 비압축된 표현을 사용할 수 있습니다. 압축된 표현에는 접두어로 02나 03을 사용하고, 비압축 표현에는 04를 사용합니다.

Paper Wallets

Paper wallets are a very effective way to create backups or offline bitcoin storage, also known as “cold storage.”
As a “cold storage” mechanism, if the paper wallet keys are generated offline and never stored on a computer system, they are much more secure against hackers, keyloggers, and other online computer threats.

종이지갑 키가 오프라인 상에서 생성된 후 컴퓨터 시스템에 저장된 적이 없다면 온라인 상의 위협에 대해서 훨씬 안전합니다. 중요한 것은 키를 생성하고 종이지갑을 생성하고 출력하는데 있어 네트워크가 완전히 끊겨진 상태여야 한다는 것입니다. bitaddress.org에서 이것을 할 수 있습니다.

종이 지갑의 단점은 인쇄된 키가 도난에 취약하다는 것입니다. 좀 더 정교한 종이지갑은 BIP-38로 암호화해서 소유주가 기억하는 패스프레이즈로 보호합니다.

종이지갑을 사용하는 장점을 제대로 살리려면 모든 금액을 한 번에 사용합니다. 잔액이 남는 경우 잔액은 다른 종이지갑으로 전송합니다.