Research on the function of Ethereum web3j plugin

Source: Internet
Author: User

Original address: http://blog.csdn.net/XinLianOrg/article/details/79270941


1. Ethereum Overview


Ethereum (Ethereum) is not an organization, but an intelligent contract on the blockchain, open source of the underlying system, ethereum from the birth to May 2017, just 3.5 of the time, the world has more than 200 ethereum applications are born. Ethereum is a platform and a programming language that enables developers to build and publish next-generation distributed applications. Ethereum can be used to program, distribute, secure and trade anything: voting, domain names, financial exchanges, crowdfunding, corporate governance, contracts and most agreements, intellectual property, and smart assets that benefit from hardware integration.


1.1 Technical features of Ethereum


1) Ethereum is a blockchain development platform, not a crypto currency for trading —--founder Vitalik Buterin. Therefore, its notable feature is programmability.


2) The client supports multiple languages: Go, C + +, Python, JavaScript, v go:go-ethereum (geth)

V C++:cpp-ethereum (Ceth)


3) The client supports a variety of operating systems and devices: Linux, FreeBSD, OS X, Windows, Docker, ARM, IOS, Smartphones, smart watches, Tablet PCs;

V benefit from the cross-platform of C + +;


4) The client is both a server-side software (peer to face, blockchain management, API Interface services) and mining software, a command line tool, or a console program. Only the client can run the full node;


5) The client (Geth, Ceth) supports Docker container deployment;


6) Provide graphical wallet software (Mist), embedded client tools, support transfer and smart contracts;


7) support a variety of programming interfaces: Jax-RPC, WS-RPC, IPC-RPC, JavaScript, the most complete feature is the JavaScript interface library web3.js;


8) The JavaScript script can be run directly under the console, and the Web3.js library can be used directly;


9) Web application pages, you can use the Web3.js library directly, or you can use the Jax-RPC, WS-RPC interface via Ajax/httpclient.


10) The Ethereum contract code is written in a low-level, stack-based bytecode language called "Ethereum Virtual machine Code" or "EVM code".



1.2 Ethereum Account

The Ethereum account is divided into two categories (all with 20-byte addresses representing accounts, and HEX16 converted to 40-byte strings):


1) External Control account (EOA): An "entity" account protected by a private key, which stores the etheric currency of the Ethereum network;


2) Smart Contract account: The account controlled by the contract code, from the point of view of the blockchain to form the same entity account, but people can not directly operate;


3) The former can only be initiated by the person of the transfer of the ether, the latter can only be under the control of the code for the transfer of the etheric currency;


4) The former can send a message to the latter, triggering its execution of the corresponding instructions or business logic, such as transfer, product purchase, etc.


5) Transaction costs are always provided by the former. To trigger the latter to run, the former provides both the cost of sending the message and the cost of running the contract. If the cost is insufficient, the contract may run to the end of the Midway. At this point, the full effect is automatically revoked, but the transaction fee is not refunded. After the trade is over, the excess gas is automatically refunded.



1.3 Smart Contracts


1.3.1 Business Perspective Smart Contracts


1) Smart contracts are systems that automatically transfer digital assets based on pre-established rules;


2) A smart contract is an event-driven, stateful, multi-recognized program that runs on a blockchain. The program is able to automatically process its managed assets according to pre-defined conditions.


3) The smart contract is a robot, has its own account, in accordance with its set up procedures, can be used in place of natural persons or legal persons strictly arbitration and execution of contracts;


4) The intelligent contract is stored on the blockchain and is automatically executed by the miner's computer.


5) The intelligent contract has the characteristics of transparent data, transparent code, non-tamper, and permanent operation;



1.3.2 Programmer Point of view smart contracts


1) A smart contract is like a stored procedure built on a blockchain database;


2) The intelligent contract like class, has the attribute, the method and the construction, the destructor function;


3) Intelligent contract like service, provide synchronous and asynchronous message interface externally;


4) Smart contracts are written in the class JavaScript high-level language and compiled into binary codes that can be run by the Ethereum Blockchain virtual machine (EVM);


5) The intelligent contract supports inheritance;


6) The smart contract can be deployed as a shared library;


7) The intelligent contract is compiled by the interface description and binary execution code.



1.4 Ethereum Architecture Description



Ethereum is an application platform built on the Blockchain 2.0 technology;


Blockchain 2.0

1) value know: The exchange rate of the virtual currency can be obtained from the external data source;

2) Block awareness: can read the internal data of the block;

3) Turing Complete: the implementation of general computer instructions;

4) Smart contract: Support to write and run smart contracts;

5) platform, support a variety of applications and virtual currency;

6) Trading faster, second-level transaction confirmation;

7) Lower energy consumption, support a variety of consensus algorithms.


Add multiple consensus algorithms and Turing-complete smart contracts;


The introduction of gas (fuel) as a service charge, increase the cost of evil, but also prevent the execution of the cycle of death;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.