mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2024-11-22 08:08:11 +00:00
index experiment and indexed glossary
This commit is contained in:
parent
f50e66a867
commit
08e974bc98
@ -15,58 +15,76 @@ More than all of these parts, bitcoin is a digital economy platform, just like t
|
||||
|
||||
==== Quick Glossary
|
||||
|
||||
bitcoin::
|
||||
bitcoin::
|
||||
((("bitcoin")))
|
||||
The name of the currency unit (the coin), the network and the software
|
||||
|
||||
address (aka public key)::
|
||||
address (aka public key):::: ((("(aka public key):::: ((("(aka public key):::: ((("(aka public key)::
|
||||
((("address (aka public key):::: ((("(aka public key):::: ((("(aka public key):::: ((("(aka public key)")))")))")))
|
||||
A bitcoin address looks like +1DSrfJdB2AnWaFNgSbv3MZC2m74996JafV+, they always start with a one. You can have as many as you like, share them so people can send you coins.
|
||||
|
||||
wallet::
|
||||
wallet::
|
||||
((("wallet")))
|
||||
Software that holds all your addresses. Use it to send bitcoin and manage your keys.
|
||||
|
||||
secret key (aka private key)::
|
||||
secret key (aka private key):::: ((("(aka private key):::: ((("(aka private key):::: ((("(aka private key)::
|
||||
((("secret key (aka private key):::: ((("(aka private key):::: ((("(aka private key):::: ((("(aka private key)")))")))")))
|
||||
The secret number that unlocks bitcoins sent to the corresponding address
|
||||
|
||||
transaction::
|
||||
((("transaction")))
|
||||
A transfer of bitcoins from one address to another.
|
||||
|
||||
hash::
|
||||
((("hash")))
|
||||
A digital fingerprint of some binary input
|
||||
|
||||
block::
|
||||
((("block")))
|
||||
A grouping of transactions, marked with a timestamp, and a fingerprint of the previous block. The block header is hashed to find a proof-of-work, thereby validating the transactions.
|
||||
|
||||
network::
|
||||
((("network")))
|
||||
A peer-to-peer network that propagates transactions and blocks among all nodes
|
||||
|
||||
blochchain::
|
||||
((("blochchain")))
|
||||
A list of validated blocks, each linking to its predecessor all the way to the genesis block.
|
||||
|
||||
genesis block::
|
||||
((("genesis block")))
|
||||
The first block in the blockchain, used to initialize the crypto-currency
|
||||
|
||||
proof-of-work::
|
||||
((("proof-of-work")))
|
||||
A piece of data that requires significant computation to find. In bitcoin, a hash that is less than a target.
|
||||
|
||||
difficulty::
|
||||
((("difficulty")))
|
||||
A network-wide setting that controls how much computation is required to find a proof-of-work.
|
||||
|
||||
target difficulty::
|
||||
((("target difficulty")))
|
||||
A difficulty at which all the computation in the network will find blocks approximately every 10 minutes.
|
||||
|
||||
difficulty re-targetting::
|
||||
((("difficulty re-targetting")))
|
||||
A network-wide re-calculation of the difficulty which occurs once every 2106 blocks and considers the hashing power of the previous 2106 blocks.
|
||||
|
||||
miner::
|
||||
((("miner")))
|
||||
A network node that finds valid proof-of-work for new blocks, by repeated hashing
|
||||
|
||||
reward::
|
||||
((("reward")))
|
||||
An amount included in each new block as a reward by the network to the miner who found the proof-of-work solution. It is currently 25BTC per block.
|
||||
|
||||
fees::
|
||||
((("fees")))
|
||||
An excess amount included in each transaction as a network fee or additional reward to the miner who finds the proof-of-work for the new block. Currently 0.5 mBTC minimum.
|
||||
|
||||
confirmations::
|
||||
((("confirmations")))
|
||||
Once a transaction is included in a block, it has "one confirmation". As soon as _another_ block is mined on the same blockchain, the transaction has two confirmations etc. Six or more confirmations is considered final.
|
||||
|
||||
|
||||
|
@ -84,36 +84,17 @@ Once a private key has been generated, the public key equivalent can be derived
|
||||
|
||||
Here's an example from the reference implementation, generating a public key from an existing private key
|
||||
|
||||
[[genesis_block_cpp]]
|
||||
.The Genesis Block, statically encoded in the source code of the reference client https://github.com/bitcoin/bitcoin/blob/0.8.4/src/key.cpp#L31[bitcoin/src/key.cpp : 31]
|
||||
[[ecc_mult]]
|
||||
.Reference Client: Using OpenSSL's EC_POINT_mul to generate the public key from a private key https://github.com/bitcoin/bitcoin/blob/0.8.4/src/key.cpp#L31[bitcoin/src/key.cpp : 31]
|
||||
====
|
||||
[source, c++]
|
||||
----
|
||||
#include <map>
|
||||
|
||||
#include <openssl/ecdsa.h>
|
||||
#include <openssl/obj_mac.h>
|
||||
|
||||
#include "key.h"
|
||||
|
||||
// Generate a private key from just the secret parameter
|
||||
int EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key)
|
||||
{
|
||||
int ok = 0;
|
||||
BN_CTX *ctx = NULL;
|
||||
EC_POINT *pub_key = NULL;
|
||||
|
||||
if (!eckey) return 0;
|
||||
|
||||
const EC_GROUP *group = EC_KEY_get0_group(eckey);
|
||||
|
||||
if ((ctx = BN_CTX_new()) == NULL)
|
||||
goto err;
|
||||
|
||||
pub_key = EC_POINT_new(group);
|
||||
|
||||
if (pub_key == NULL)
|
||||
goto err;
|
||||
|
||||
[...initializtion code ommitted ...]
|
||||
|
||||
if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, ctx)) <1>
|
||||
goto err;
|
||||
@ -121,17 +102,7 @@ int EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key)
|
||||
EC_KEY_set_private_key(eckey,priv_key);
|
||||
EC_KEY_set_public_key(eckey,pub_key);
|
||||
|
||||
ok = 1;
|
||||
|
||||
err:
|
||||
|
||||
if (pub_key)
|
||||
EC_POINT_free(pub_key);
|
||||
if (ctx != NULL)
|
||||
BN_CTX_free(ctx);
|
||||
|
||||
return(ok);
|
||||
}
|
||||
[...]
|
||||
----
|
||||
<1> Multiplying the priv_key by the generator point of the elliptic curve group, produces the pub_key
|
||||
====
|
||||
@ -141,7 +112,6 @@ err:
|
||||
The size of bitcoin's private key, 2^256^ is a truly unfathomable number. It is equal to approximately 10^77^ in decimal. The visible universe contains approximately 10^80^ atoms.
|
||||
====
|
||||
|
||||
|
||||
=== Simple Transactions
|
||||
=== Wallets, addresses and coins
|
||||
=== The Blockchain
|
||||
|
Loading…
Reference in New Issue
Block a user