Blockchain accounts get bigger
constructor(index,timestamp,data,previousHash=' 39;)< br />{
this.index=index;< br />this.timestamp=timestamp;< br />this.data=data;< br />this.previousHash=previousHash;< br />$this.hash=this.calculateHash();< br />}
calculateHash(){
return SHA256(this,index+this.previousHash+this.timestamp+JSON.stringify(this.data)).tostring();< br />}
}
class Blockchain{
constructor(){
this.chain=[this.createGenesisBlock()];<
}
/ / create a generated information block
creategenesis block() {
return new block (0, & quot; 01/01/2019",& quot; Genesis block", 0);
/ / the date is the user's data. In fact, it is the hash value obtained by adding several values together. Here, the information is encrypted and the picture is encrypted. Then the data is still stored in the database, but all the data are hash values. To get this data, you must know the hash value of the previous data block. Then, if the hacker needs to crack all the nodes, the hash value is decrypted, Then all the blocks from the first node to the last node can be decrypted to get the real data. So the security of data stored in the blockchain depends on whether the data is encrypted. If the plaintext is not encrypted, then it is not a blockchain
}
/ / get the last block
getlatesblock() {
return this.chain [this.chain. Length-1]
}
/ / create block
addblock (newblock) {
newblock. Previoushash = this. Getlatesblock(). Hash< br />newBlock.hash=newBlock.calculateHash();< br />this.chain.push(newBlock);< br />}
}
blockchain is essentially an encryption algorithm, which is based on the principle of hash 256 bit algorithm to achieve information security; The application of modern information will become more and more global and universal. Besides the basic requirements of anti tampering, anti repudiation and trustworthiness, the protection of privacy needs to be strengthened. The blockchain technology is proced because of the development of modern cryptography. The cryptography used today is the result of cryptography 20 years ago, Therefore, in order to apply the blockchain technology to more participation scenarios, especially in the Internet economy, more verification is needed to verify whether the existing encryption technology can meet the demand, and more in-depth integration of cryptographic frontier technology and continuous innovation are needed
as long as we use blockchain to make innovations in accounting methods based on our own mode, it will not affect efficiency and waste computing power, but will shorten the time and improve efficiency.
1. What the Internet changes is the acquisition and transmission of information, while what blockchain does is the transmission of value
for example, on the Internet, we can easily and quickly generate information and it to any place. All information can be spread efficiently, but some valuable information that can only be transferred but cannot be shared often needs credit endorsement
for example, we can't the payment directly to the other party, but we need to subtract some money from the payment account and add some money to the collection account to complete the payment process. The current Internet protocol does not support the function of value transfer. The current value transfer is not direct transmission. Instead, it is endorsed by a centralized third party, such as Alipay, such as banks.
now these centralized organizations put all the calculation of value transfer in a centralized server, which will certainly involve the participation of people, which will cause many problems, such as some "finite theory" and "opportunistic behavior", which will make the whole behavior less credible. So there is a basic question, how to reach a credit consensus
this is how blockchain technology came into being. It can be said that blockchain can build a pure point-to-point value transfer system. Without the mutual trust of each node, blockchain can ensure the integrity and security of data records in the system, and can be separated from the endorsement of third-party organizations, effectively recing the complexity and risk of transactions
2. It is open and transparent, and can not be tampered with
all data of the blockchain can not be tampered with or deleted, and the information of the whole system is open and transparent. If someone owes you a sum of money, and now the data has been put on the blockchain, if he doesn't want to return it to you and play a rogue with you, you can go to the court to protect your rights through the data forensics on the blockchain, so as to get back your legitimate funds. Because the data on the blockchain is open to the whole network, the users of the whole network will know his rogue behavior, which will greatly increase his credit cost. Dishonesty will make him have an important impact in the next life.
Ledger is a book with a certain format and several account pages. Based on the accounting documents, it records all economic business in chronological order and classification, which is what we usually call the ledger. Blockchain represents a unique data record format. Blockchain is "block + Chain". The so-called block is the meaning of data block. Each block is connected by a certain mark to form a chain
Super ledger
hyperledger (Chinese name is super ledger, collectively referred to as hyperledger) is an open source project launched by Linux foundation in 2015 to promote blockchain digital technology and transaction verification. The goal of hyperledger is to enable members to work together to build an open platform to meet the needs of various users from different instries, while greatly simplifying the business process. The founding members of hyperedge include IBM, Intel, Cisco and other large companies. By the end of this book, more than 183 organizations and companies have joined hyperedge, and they are growing rapidly
at the beginning of hyperledger project, Linux foundation has received a number of different code bases, including IBM code base (inspired by Ethereum to a certain extent), Dah (bits of proof bitcoin code base) and sockstream code base (an extension of bitcoin code base). In addition, there are digital asset and ripple contributions. With the development of the instry, a single project has been unable to meet the needs of the business, so hyperledger has graally developed from a single project into a project group. At present, hyperledger is not a specific technology, but a set of blockchain technology frameworks. Up to now, the hyperledger project team contains 9 formal projects and more than 50 moles related to these formal projects
the Xueshuo innovation blockchain Technology Workstation of Lianqiao ecation online is the only approved "blockchain Technology Specialty" pilot workstation of "smart learning workshop 2020 Xueshuo innovation workstation" launched by the school planning, construction and development center of the Ministry of ecation of China. Based on providing diversified growth paths for students, the professional station promotes the reform of the training mode of the combination of professional degree research, proction, learning and research, and constructs the applied and compound talent training system
Hyperledger is an open source project launched by Linux foundation in 2015 to promote blockchain digital technology and transaction verification. It is composed of 30 initial enterprise members (including IBM, Accenture, Intel, J.P. Morgan, R3, Dah, DTCC, Fujitsu, Hitachi, swift, Cisco, etc.). The goal is to let members work together to build an open platform, meet various user cases from different instries, and simplify business processes
digital currency and blockchain idea, provides the prototype of blockchain technology application
- Ethereum - breaks free from the shackles of digital currency, and the birth of smart contract extends the function of blockchain technology
- Super ledger - further introces access control and security, It is the first time to introce blockchain technology into the application scenario of distributed alliance ledger
the Xueshuo innovation blockchain Technology Workstation of Lianqiao ecation online is the only approved "blockchain Technology Specialty" pilot workstation of "smart learning workshop 2020 Xueshuo innovation workstation" launched by the school planning, construction and development center of the Ministry of ecation of China. Based on providing diversified growth paths for students, the professional station promotes the reform of the training mode of the combination of professional degree research, proction, learning and research, and constructs the applied and compound talent training system