Why does Ethereum trade with nonce
In Ethereum, all kinds of transfer and other transaction operations need to be completed by accounts. In the transaction platform, such as currency exchange transaction platform, each transaction needs to have a transaction initiation account and a transaction receiving account. Each account corresponds to an address, and the account name is the label of the address. Use a wallet to manage accounts. A wallet can contain multiple accounts. Of course, you can also create multiple wallets
There is an essential difference between Ethereum and bitcoin. What is the difference? Bitcoin defines a set of currency system, while Ethereum focuses on building a main chain (which can be understood as a road) to allow a large number of blockchain applications to run on this road
from this point of view, Ethereum's application scenarios are more extensive, which is why we say that Ethereum marks a simple monetary system in the era of blockchain
1.0, and a transformation to other instries and application scenarios in the era of blockchain 2.0
however, there is no perfect thing in the world. Although Ethereum has expanded the application scope of blockchain in all walks of life and improved the speed of transaction processing, it also has some disputes and doubts
first, the solution to the lack of scalability of Ethereum: slicing technology and lightning network
the bottom design of Ethereum, the biggest problem is that Ethereum has only one chain and no side chain, which means that all programs have to run on this chain equally, consuming resources and causing system congestion. Just like last year's very popular Ethereum game "encryption cat", when this game was very popular, it once caused Ethereum network paralysis
to improve the processing capacity, Ethereum proposes two ways: shard and lightning network. Let's introce these two technologies respectively
(1) fragmentation technology
vitalik buterin, founder of Ethereum, believes that the reason why mainstream blockchain networks such as bitcoin process transactions very slowly is that every miner has to process every transaction in the whole network, which is actually very inefficient. The idea of fragmentation technology is: a transaction does not need to be processed by all nodes in the whole network, as long as some nodes (miners) in the network are allowed to process it. Therefore, Ethereum network is divided into many pieces. At the same time, each piece can handle different transactions. In this way, the network performance will be greatly improved
however, the slicing technology is also controversial. As we all know, the important idea of blockchain technology is decentralization. Only when the whole network witnesses (processes) the same transaction can it have the highest authority. The Ethereum slicing technology is similar to the group witness, not all nodes witness together. In this way, it will lose the absolute "decentralization" attribute, and can only achieve the purpose of high performance by sacrificing certain characteristics of decentralization
(2) lightning network
lightning network uses the way of transaction under the chain. What does that mean? It means: when the participants of lightning network transfer money to each other, they do not need to confirm the transaction through the main chain of Ethereum, but create a payment channel between the participants and complete it under the chain
however, lightning network is not separated from the main chain. Before establishing a payment channel, you need to use the assets on the main chain as collateral to generate a balance proof, which indicates that you can transfer the corresponding balance. In the case that both parties of the transaction hold the balance certificate, both parties can make unlimited number of transfers under the chain through the payment channel
only when the off chain transaction is completed and the assets need to be transferred back to the chain, the balance change information of the main chain account will be registered on the Ethereum main chain, and no matter how many transactions occur ring this period, there will be no record on the main chain
another real benefit of lightning network is that it can save the cost of miners for you. At present, when we trade on the main chain of Ethereum, we need to consume gas and pay for miners. Once we move the transaction to the lower chain, we can save this part of the cost
Of course, lightning network is not perfect. When using the lightning network, the assets on the main chain should be used as collateral; And this part of assets as collateral can not be used before the user completes the transaction under the chain. This also determines that lightning trading is only suitable for small transactionsthe above is the problem of insufficient scalability of Ethereum, as well as the two main solutions: fragmentation technology and lightning network
Second, there are loopholes in Ethereum's smart contract and the infamous Dao event
Ethereum's smart contract is very powerful, but there are loopholes in any code. The biggest controversy of Ethereum's smart contract lies in the so-called loopholes, that is, security issues. According to relevant research, 34200 (about 3%) of the nearly 1 million smart contracts based on Ethereum contain security vulnerabilities, which will allow hackers to steal eth, freeze assets or delete contracts, such as the infamous Dao incident
(1) what does Dao meanbefore introcing the Dao event, let's first introce what Dao is. Dao is the abbreviation of decentralized
autonomous organization, which can be understood as decentralized autonomous organization. From the perspective of Ethereum, Dao is a kind of contract or a combination of contracts on the blockchain, which is used to replace the government's review and complex intermediate proceres, so as to achieve an efficient and decentralized trust system. Therefore, Dao is not a specific organization, that is to say, there can be many Dao, all kinds of Dao
(2) the infamous Dao event
however, when we talk about Dao now, we basically refer to the Dao event, that is, the infamous hacker attack event we just mentioned. As we know, the English word "the" refers to "the Dao event". The Dao event
refers to "the Dao event", because we just said that Dao is not a specific organization, there can be many Dao, all kinds of Dao
in 2016, slock.it, a German company focusing on "smart locks", launched the Dao project on Ethereum in order to realize decentralized physical exchange (such as apartments and ships). Since April 30, 2016, the financing window has been open for 28 days
unexpectedly, this Dao project is very popular. It raised more than US $100 million in just half a month. By the end of the whole financing period, it raised a total of US $150 million. Therefore, it has become the largest crowdfunding project in history. However, it didn't last long. In June, hackers took advantage of the loopholes in the smart contract to successfully transfer more than 3.6 million Ethernet coins and put them into a Dao sub organization, which has the same structure as the Dao. At that time, the price of Ethernet currency fell directly from more than $20 to less than $13
this event shows that there are loopholes in smart contracts, and once the loopholes are exploited by hackers, the consequences will be very serious. This is why many people criticize Ethereum and say that its smart contract is not smart
to solve this problem, many foreign companies begin to provide code audit services in order to solve the vulnerability problem of smart contract. From a technical point of view, some teams are currently testing smart contracts. Most of these teams are led by professors from Harvard, Stanford and Yale, and some of them have obtained investment from leading institutions
in addition to the problems of insufficient expansibility and loopholes in smart contracts, the controversy over Ethereum lies in the POS consensus mechanism it pursues, that is, the proof of equity mechanism. Under the proof of equity mechanism, if anyone holds more money and holds it for a longer time, he will get more "rights" (interests) and have the opportunity to get bookkeeping power, Bookkeeping can also be rewarded. In this way, it is easy to create the oligarchic advantage of "the stronger the stronger"
Another problem is the chaos of ICO. ICO is a common way to raise funds for blockchain projects, which we can understand as pre-sale. The outbreak of ICO projects on Ethereum has caused illegal activities such as fund allocation and money fraud under the banner of ICO, which has caused security risks to social and financial stabilitymany new users believe that the sole purpose of mining is to generate ether in a way that does not require a central issuer (see our guide "what is ether?"). It's true. The token of Ethereum is proced in the process of mining, with a mining rate of 5 Ethereum coins per piece. But mining is at least as important. Usually, banks are responsible for keeping accurate records of transactions. They make sure that money is not created out of thin air and that users don't cheat and spend money many times. However, blockchain introces a new way to keep records, the whole network instead of intermediary, to verify transactions and add them to the public ledger
Ethereum mining
although "no trust" or "trust minimization" monetary system is the goal, there are still people who need to ensure the security of financial records and ensure that no one cheats. Mining is one of the innovations that makes decentralized records possible. Miners have reached a consensus on the history of transactions in terms of preventing fraud (especially double spending on ether) - an interesting issue that hasn't been addressed before the decentralized currency works on the blockchain. While Ethereum is looking at other ways to reach a consensus on the effectiveness of the deal, mining currently keeps the platform together
how mining works
today, the mining process of Ethereum is almost the same as that of bitcoin. For each transaction, the miner can use the computer to guess the answer repeatedly and quickly until one of them wins. More specifically, the miner will run the unique header metadata (including time stamp and software version) of the block through the hash function (which will return a fixed length, unordered string of numbers and letters, which appears to be random), changing only the 'nonce value', which will affect the hash value of the result
if the miner finds a hash that matches the current target, the miner will be granted ether and broadcast the block across the network for each node to verify and add to their own ledger . If miner B finds the hash, miner a stops working on the current block and repeats the process for the next block. It's hard for miners to cheat in this game. There is no way to fake the work and come up with the right answer to the puzzle. That's why solving puzzles is called "proof of work."
on the other hand, others have little time to verify whether the hash value is correct, which is exactly what each node does. About every 12-15 seconds, a miner finds a stone. If the miner starts to solve the puzzle faster or slower than this, the algorithm will automatically re adjust the difficulty of the problem so that the miner can rebound to about 12 seconds of solution time
miners earn these ethers randomly, and their profitability depends on their luck and the computing power they put in. The specific workload verification algorithm used by Ethereum is called "ethash", which aims to require more memory, making it difficult to mine with expensive ASIC. Special mining chips are now the only profitable way to mine bitcoin
in a sense, ethash may have achieved this goal successfully, because dedicated ASIC is not available for Ethereum (at least not yet). In addition, as Ethereum aims to shift from proof of work mining to "proof of equity" (which we will discuss below), buying ASIC may not be a wise choice because it may not prove useful for a long time< However, Ethereum may never need miners. Developers plan to abandon proof of work, the algorithm currently used by the network to determine which transactions are valid and protect them from tampering to support proof of equity, which is guaranteed by token owners. If and when the algorithm is launched, proof of equity can become a means to achieve distributed consensus, and the consensus uses less resources.
according to the report, Zhejiang blockchain government platform is mainly engaged in blockchain bills, especially medical bills. The public platform of Changsha's SMIC blockchain mainly focuses on government information disclosure, government affairs handling, intellectual property protection, judicial expertise, finance and so on, but it has not involved the medical bills yet.
eth0 to awk for processing
where - F & # 39;:|< br />+'
this is a separator defined by awk and then matched with "BCAST & quot;, Take the content of the fourth column
since your command is not universal, you can't output the result here, but you should intercept the broadcast address
Transaction
the behavior of blockchain transaction follows different rule sets
< UL >e to the distributed and unlicensed nature of public blockchain, anyone can sign the transaction and broadcast it to the network
according to different blockchains, traders will be charged a certain transaction fee, which depends on the needs of users rather than the value of assets in the transaction
blockchain transactions do not require any central authority verification. It only needs to use the digital signature algorithm (DSA) corresponding to its blockchain to sign it with the private key
once a transaction is signed, broadcast to the network and mined into a successful block in the network, the transaction cannot be recovered
Ethereum transaction structure
Ethereum transaction data structure: transaction 0.1 eth
{& 39; nonce': 39; 0x00', // Decimal: 0
& 39; gasLimit': 39; 0x5208', // Decimal system: 21000
& 39; gasPrice': 39; 0x3b9aca00', // Decimal system: 10000000000
& 39; to': 39; 39; ,// Sending address
& 39; value': 39; 0x16345785d8a0000',// 100000000000000000 ,10^17
' data': 39; 0x', // Decimal representation of null data; chainId': 1 / / blockchain network ID
}
these data have nothing to do with the transaction content, but have something to do with the execution mode of the transaction. This is because when you send a transaction in Ethereum, you must define some other parameters to tell miners how to handle your transaction. Transaction data structure has two attribute designs & quot; gas": & quot; gasPrice",& quot; gasLimit"
" gasPrice": The unit is Gwei, which is 1 / 1000 eth, indicating the transaction cost
& quot; gasLimit": The maximum gas charge allowed for the transaction
these two values are usually filled in automatically by the wallet provider
in addition, you need to specify which Ethereum network to execute the transaction (chainid): 1 represents the Ethereum main network
ring development, tests are usually carried out locally and on the test network, and transactions are carried out through the test eth issued by the test network to avoid economic losses. After the test, enter the main network transaction
in addition, if you need to submit some other data, you can use & quot; data" And & quot; nonce" Attach as part of a transaction
a nonce (number used only once) is the value used by Ethereum to track transactions, which helps to avoid double spending and replay attacks in the network
Ethereum transaction signature
Ethereum transaction involves ECDSA algorithm. Taking JavaScript code as an example, the popular ethers.js is used to call ECDSA algorithm for transaction signature
you can use the online application composer to deliver signed transactions to Ethereum. This is known as "offline signature.". Offline signatures are particularly useful for applications such as status channels, which are smart contracts that track the balance between two accounts and transfer funds after a signed transaction is submitted. Offline signature is also a common practice in dexes
you can also use online wallet to create signature verification and broadcast through Ethereum account
with Portis, you can sign a transaction to interact with the gas station network (GSN)
< / UL >
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