mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2025-01-11 00:01:03 +00:00
fixed heading and command output
This commit is contained in:
parent
774a778a45
commit
2a5a865f17
@ -380,7 +380,7 @@ Here's the same key, encoded in WIF and WIF-compressed formats
|
||||
"Compressed private keys" is a misnomer! They are not compressed, rather the WIF-compressed format signifies that they should only be used to derive compressed public keys and their corresponding bitcoin addresses. Ironically, a "WIF-compressed" encoded private key is one byte longer because it has the added 01 suffix to distinguish it from an "uncompressed" one.
|
||||
====
|
||||
|
||||
==== Implementing Keys and Addresses in Python
|
||||
=== Implementing Keys and Addresses in Python
|
||||
|
||||
The most comprehensive bitcoin library in Python is "pybitcointools"by Vitalik Buterin (https://github.com/vbuterin/pybitcointools). In the following code example, we use the pybitcointools library (imported as "bitcoin") to generate and display keys and addresses in various formats:
|
||||
|
||||
@ -393,26 +393,16 @@ include::code/key-to-address-ecc-example.py[]
|
||||
Here's the output from running this code:
|
||||
----
|
||||
$ python key-to-address-ecc-example.py
|
||||
Private Key (hex) is: 3c8a71bb695971173ccae60a45318344be0cf9417cce96f6567bd75f63a1907b
|
||||
Private Key (decimal) is: 27383380759877199262221438557833276618414788020082369083037022892126887841915
|
||||
Private Key (WIF) is: 5JGx1pWAQajcVG6wTRxh8tgABamvFYTDwzQptbhvmExbCzb8ttL
|
||||
Private Key Compressed (hex) is: 3c8a71bb695971173ccae60a45318344be0cf9417cce96f6567bd75f63a1907b01
|
||||
Private Key (WIF-Compressed) is: KyFPpcfiX5u5djfDMfAp9q5qXi5G3Bpk9iQANkBeJGcMyt8hRq3b
|
||||
Public Key (x,y) coordinates is: (33709093068486263861880850179979243620450326373098856144029226806527777418227L, 87754931750760896623087037281983555752553586136725155039294247309811192676148L)
|
||||
Public Key (hex) is: 044a86aba96feef152a5b874c6837c0f7ed5682ae187a4d6e3054e840b713dabf3c20387fe07e0acc79ffc6471df76bd8cfeb417814ffaf5aa13a351b12fd3bf34
|
||||
Compressed Public Key (hex) is: 024a86aba96feef152a5b874c6837c0f7ed5682ae187a4d6e3054e840b713dabf3
|
||||
Bitcoin Address (b58check) is: 1JXa2Ed859qjc34NZpuWBw4DbsuDM29iVU
|
||||
Compressed Bitcoin Address (b58check) is: 1B6bnePrivate Key (hex) is: 8fef4b5db53784bf1ba9eb71ef29fed17e0dd303eaaec86a30758ddc3926b379
|
||||
Private Key (decimal) is: 65103533953224540524547925689829615797042404424439863593942250239002409350009
|
||||
Private Key (WIF) is: 5JugCdctbqsPLTjMpWKiwD4zUWMBmcPSmk3qV7ChZGvGb28Xpsf
|
||||
Private Key Compressed (hex) is: 8fef4b5db53784bf1ba9eb71ef29fed17e0dd303eaaec86a30758ddc3926b37901
|
||||
Private Key (WIF-Compressed) is: L23W2LdQknhPatyxtgRe6GGcgQY6XuC4kV1X14Ne1TG7nwmHYYsG
|
||||
Public Key (x,y) coordinates is: (67578901098964128544627522542591015499444294518340016249145862167441690490539L, 28310898985008778347793460074000413092507596924295253907953807553014541258705L)
|
||||
Public Key (hex) is: 0495684d742137171b53e82e1f7c80f9990b6882dee4ffa7d4b7b8d6676c2276ab3e9766a677835fc0841d68d0b51c5c28358240758e6bcf852cbcb884822b0fd1
|
||||
Compressed Public Key (hex) is: 0395684d742137171b53e82e1f7c80f9990b6882dee4ffa7d4b7b8d6676c2276ab
|
||||
Bitcoin Address (b58check) is: 1EfvZqAJM9AUcAwFHKQodK7rKzcbVRqztw
|
||||
Compressed Bitcoin Address (b58check) is: 14oxVkXBUsxZSWqjR3i9Q4ru9MPVNpH3LE
|
||||
|
||||
Private Key (hex) is: 3aba4162c7251c891207b747840551a71939b0de081f85c4e44cf7c13e41daa6
|
||||
Private Key (decimal) is: 26563230048437957592232553826663696440606756685920117476832299673293013768870
|
||||
Private Key (WIF) is: 5JG9hT3beGTJuUAmCQEmNaxAuMacCTfXuw1R3FCXig23RQHMr4K
|
||||
Private Key Compressed (hex) is: 3aba4162c7251c891207b747840551a71939b0de081f85c4e44cf7c13e41daa601
|
||||
Private Key (WIF-Compressed) is: KyBsPXxTuVD82av65KZkrGrWi5qLMah5SdNq6uftawDbgKa2wv6S
|
||||
Public Key (x,y) coordinates is: (41637322786646325214887832269588396900663353932545912953362782457239403430124L, 16388935128781238405526710466724741593761085120864331449066658622400339362166L)
|
||||
Public Key (hex) is: 045c0de3b9c8ab18dd04e3511243ec2952002dbfadc864b9628910169d9b9b00ec243bcefdd4347074d44bd7356d6a53c495737dd96295e2a9374bf5f02ebfc176
|
||||
Compressed Public Key (hex) is: 025c0de3b9c8ab18dd04e3511243ec2952002dbfadc864b9628910169d9b9b00ec
|
||||
Bitcoin Address (b58check) is: 1thMirt546nngXqyPEz532S8fLwbozud8
|
||||
Compressed Bitcoin Address (b58check) is: 14cxpo3MBCYYWCgF74SWTdcmxipnGUsPw3
|
||||
----
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user