uchain architecture - UCHAIN-WORLD/uchain-fullnode GitHub Wiki
UCHAIN Architecture
The UChain consists of 8 modules, include Wallet, Transaction(Txs), Consensus(Blocks), Network(P2P Network), API(RPC), Smart Contract, Microservices and SDK.
Architecture Overview
Describe the relationship between major functional modules (red squares) , some basic services (grey square black borders) and other services.
The system consists of three layers, namely UChainApp, UChainService and UChain. The white paper consists of four layers, which combine the API/SDK layer and the service layer into a service layer. In fact, there is also the bottom layer of the data layer, which is also combined with the core layer as the core layer.
UChainApp
-
UID UCHAIN digital identity, based on the UTXO model, can completely replace the role of the address (which can receive and send tokens), as well as verify special transactions (some advanced features such as applying to become a super node must have a digital identity). Generate credit and equity based on digital identity. It can represent individuals, organizations and support joint signatures as well.
-
Token Credentials for some basic activities in the chain, such as voting requires a token named Vote, and a block reward requires a block token. Each sub-chain also needs its own token to record the transaction in blockchain.
-
UPOS Proof of Byzantine fault-tolerant user rights. Super nodes are billed and they are selected by vote. Common user locks have rewards.
-
Child Chain The sub-chain interacts with the main chain through the microservice call. The sub-chain calls the main chain SDK to implement the transaction record in blockchan. The sub-chain can also provide services to the main chain by means of the microservice code hashing the main chain.
-
APP Third parties can call the main chain microservices SDK to implement richer feature applications, support all languages and all platforms.
-
DAPP Based on the distributed application of smart contracts, the main chain mainly implements deposit and token exchange, and the sub-chain implements a completed smart contract virtual machine.
-
Lightwallet Light wallet, peer-to-peer unsynchronized block but with other full-featured wallets, support for the Web, Android and other mobile version.
-
Other application Frontend, the wallet user interface, implement a front-end interface by calling the API and support tray in windows and mac system by calling the API. Exchange, the exchange.
UChainService
- Wallet A tool for managing private keys, generating mnemonics, deriving addresses according to the HD wallet specification, starting with address U.
- Txs The UTXO model, 5 kinds of transaction scripts, supports extensions to implement Token, UID and memory pool.
- Blocks Miners package transactions into blocks. we will have the support expansion to achieve smart contracts, fork processing and implementation of orphan pool.
- P2P Network Implementation of PBFT between super nodes.
- API(RPC) Implement the basic command call interface, http and json, the implementation of the Restful specification.
- Smart Contract The implementation of deposit and token exchange, virtual machine implementation, trigger rules, gas.
- Microservices Support private chain and SDK and implement some smart contracts.
- SDK Full language support SDK, full platform support. The difference with the API is that it is more secure, and it is a connection, and it is more powerful.
UChain
- Encryption Algorithms And Coding Support wallet, the main encryption algorithm is secp256, other algorithms are AES256, SHA256, ripemd160, Base58 and so on.
- Data transfer and connection management Bitcoin network protocol data management, involving node discovery, transaction data and block data transmission.
- Memory Pool Maintain transactions that are not in the block.
- Data Storage In-memory database and persistence operations involving maintenance of blocks, transactions, wallets, UIDs, Tokens, and other data structures.
- Verification engine Transaction verification, memory pool verification, package-in-block verification, orphan block pool verification, and verification of legality in the middle of the fork.
- RPC implement with http and json.
- Origin Transaction Bitcoin original transaction structure implementation, input, output, lock script, etc.
- Origin Block The implementation of the original block of Bitcoin, the implementation of the Merkel tree.
- Origin Miner implement the logic of packing transaction into block.