GO language block chain technology --- encrypted electronic currency and block chain

Foundations of Cryptography
symmetric encryption: Encryption and decryption both use the same key. For example: DES, AES-GCM, ChaCha20 other
asymmetric encryption: key encryption and decryption keys used are not the same, are known as: a public key, private key, and public key algorithms are disclosed, private key is kept secret. Asymmetric encryption algorithms lower performance, but superior safety due to its encryption, asymmetric encryption algorithm can encrypt data length is limited. For example: RSA, DSA, ECDSA, DH , ECDHE like.
Hashing algorithm: converting information of an arbitrary length of the shorter fixed-length value, which is usually much smaller than the message, and the algorithm is not reversible. For example: MD5, SHA-1, SHA -2, SHA-256 , etc.
Digital Signature: later information together with a piece of content (value information through the hash), certification information can not be modified. hash value is usually encrypted (ie signature) and then sent with the message, to ensure that this song hash value is not modified

Key
asymmetric public and private key encryption is
1, generating a public and private key pairs
2, the information encrypted by the public, there is only the corresponding private key can decrypt the
bits used mainly credits the ECDSA (Elliptic Curve signature algorithm), this algorithm has two characteristics
1, just know that the private key, the corresponding public key can be calculated
2, the signed with the private key things, you can use the public key to verify that there are paired private key signature

LevelDB

Bitcoin client
1, the reference implementation Core Bitcoin
2, compiled: compiling at the Ubuntu; cross compiler for Windows
3, using the command line under JSON-RPC API: acquiring information block chain; obtaining network information; acquiring node information

P2PKH: Pay to Public Key Hash
other transactions script:
P2PK (the Pay-to-Public-Key) script
MS (Mutil-Signature) script
OP_RETURN operating
P2SH (Pay-to-Script- Hash) script

Transaction memory pool
1, to receive a trade broadcasting, and verify the transaction by the pool of
orphans trading pits
UXTO pool

Network node type Bitcoin
wallet (Wallet), miners (Miner), completely block chains (Full Blockchain), network routing (Network Routing Node)

Bitcoin expand the network node
reference node implemented completely block the hinge point, individual mining node, lightweight wallet node, the service node pool protocol, mining node, node lightweight Stratum wallet

Bloom Filters

Mining required hardware: CPU, graphics card, FPGA, ASIC mining machine

Soft bifurcated: backbone, backup chain block orphan

Pool allocation algorithm interests of mine: PPS (Pay Per Share), PPLNS (Pay Per Lash N Shares), Score

Consensus attack:
51% attack, the attack will not affect the consensus of the user's private key and the encryption algorithm, the signature can not, can not be reassigned bitcoin, you can not change the past or change the parity bit currency holdings record, double pay

Bitcoin flaw:
trade confirmation for a long time, throughput, low-
PoW mining waste of computing resources
ASIC mining machine appears to make public participation decreased, calculate stress concentration
is not completely anonymous
can not store too many digital assets
does not support complex script language

Shorten the time of transaction confirmation method:
reduce the average time to produce a block (such as Litecoin, Ethereum)
centralized service (coinbase.com)
trusted address multisignature
open trade and joint server
POS and DPOS
Segwit and lightning network

POS (Proof of Stake)
in August 2012, PPC was born, PoS introduced the concept of
who is eligible to write the block chain?
Node (Stake Holder) mining waste of resources, wealth can be responsible for generating the block, no competition
occurs mineral pool, the decentralization and security are threatened
coins age

Delegated POS: Vote electoral system
, for example: steemd

Why isolate witness (Segwit):
signature may change, resulting in ductility Bug
signature accounted for about 65% of the space

About Lightning network
-based micro-payment channel evolved
essentially a smart contract (sequence may rescind the contract expires, RSMC: Revocable Sequence Maturity Contract)
if there is no direct network access, can be indirect transfer (hash time through other channels connected lock contract, HTLC: Hashed Timelock contract)

Guess you like

Origin www.cnblogs.com/lessons/p/11923932.html
Recommended