Block chain DAPP development portal application code to achieve scene

The first chapter outlines smart contract

Intelligent contract is running] A code block chain on the public chain.

Public chain block chain can be understood as the operating system, the virtual machine is intelligent contract code runs after the environment programming language compiler.

1. block chain

1.1 block chain basics

Block chain is usually understood as a super books, accounts and account transfers can be done directly through the transaction, but this is different from traditional bank transfer.

(1) This is a completely decentralized financial system. Because the entire system does not have such a centralized department to manage account information. The user only needs to be generated according to an asymmetric encryption algorithm [] a key pair, a public key account whose address is often said that the purse block chain [address], this address can be spread in the network, allowing the network All accounts to access and use.
Because the private key is very complicated, so the block will be a private key chain wallet symmetric encryption, password input by the user as a human can understand private key encryption key, if you forget the password decryption key, the user will lose the account operating authority, can only view balances and make transfers but can not use, this is the social media often report cases of missing Bitcoin.

(2) This is a completely decentralized system of books. Traditionally, the transfer A to B 100, to the bank A deduction 100, 100 to add B to produce two records. The transaction took place on the block chain is completely different, every transaction is a transfer records, if the transaction is successful is recognized throughout the block chain network can transfer success, and will transfer records stored in the block chain inside the database, each block chain node can access and manipulate the database, and anyone can query the account information of both parties. BTC transfers, in addition to be transferred to the other side, but also the balance of the account transferred to his own, which would generate many records, BTC did not do so because the account balance design.

(3) occurs in the transaction chain block is stored on all the nodes in the whole chain network of the block, and is also disclosed to be investigated. But even if we can see all transactions and account balances at an account, it can not be linked with the real life of the people.

1.2 blocks

The effect is to block the transaction data in different time periods according to a certain format and number, packaged into structured data, to facilitate storage and management. Only to be packaged into blocks and is recognized by the whole chain of the public network transactions, can be considered truly effective trading. An ether such as time Square blocks spaced about 15s, and a bit credits networks require a tile generated only 10min.

1.3 Chain

1.4 mining

Block before being added to the chain block, all the blocks can not generate tile data. This process has a certain threshold, need to filter out a trusted node to generate the data, and then to verify the validity of its data generated by other nodes. This blocks the production process will be exciting digital currency, so many nodes will join the competition in the production block. This process is referred to as a mining, data generated while the node is referred to miners.

A person can become a successful block to get the reward, the reward system of incentives is divided into transaction fees and transactions in each transaction data, the transfer can manually set the fees, fees for these awards miners packed jobs. The higher fee when the transfer set, the shorter the time of transfer, the transfer speed is faster.

1.5 Consensus Algorithm 

In order to continue to generate blocks and recognized all network nodes scheme called consensus algorithm, known as PoW (Proof of Word).

1.6 bifurcation

Since the entire block chain system is a point-to-peer network, there is no unified central authority to coordinate the behavior of each node, each acts are independent of each other, there are cases while producing blocks. To solve this problem, the block chain uses decision-making to abandon a long-chain exercise. Solitaire application with reference to the micro-channel group, a plurality of persons selects the same number.

1.7 Attack

2. Place intelligent Ethernet contract

2.1 Ethernet Square

Ethernet Square on the basis of Bitcoin network adds an Ethernet intelligent Square contract a virtual machine, namely EVM. Became a programmable decentralized platform, any system developers to deploy after paying a certain fee, you can have a completely decentralized business systems.

Ether Square account two types: (1) Smart contract account: nonce, balance, Hash value of the stored data (2) external accounts: nonce, the balance of the composition.

2.2 Smart Contract

Public Square chain Ethernet is the operating system, the EVM is a block code block chain, and the block chain Solidity is a programming language, written in a programming language is referred to as a smart logic module contract.

2.3 DAPP Decentralized Application (decentralized applications)

 

 

Guess you like

Origin www.cnblogs.com/pzyin/p/12350719.html