bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 3쪽 중 1쪽
Advanced Decentralized Blockchain Platform
Whitepaper Version: 2.0
TRON Protocol Version: 3.2
TRON DAO
December 10th, 2018, San Francisco
1. Introduction
4
1.1 Vision
4
1.2 Background
4
1.3 History
5
1.4 Terminology
6
Address/Wallet
6
ABI
6
API
6
Asset
6
Bandwidth Points (BP)
6
Block
6
Block Reward
6
Block Header
6
Cold Wallet
7
DApp
7
gRPC
7
Hot Wallet
7
JDK
7
KhaosDB
7
LevelDB
7
Merkle Root
7
Public Testnet (Shasta)
8
RPC
8
Scalability
8
SUN
8
Throughput
8
Timestamp
8
TKC
8
TRC-10
8
TRX
8
2. Architecture
9
2.1 Core
10
2.2 Storage
10
2.2.1 Blockchain Storage
10
2.2.2 State Storage
10
1
2.3 Application
10
2.4 Protocol
11
2.4.1 Protocol Buffers
11
2.4.2 HTTP
11
2.5 TRON Virtual Machine (TVM)
11
2.6 Decentralized Exchange (DEX)
11
2.7 Implementation
12
3. Consensus
13
3.1 Delegated Proof of Stake (DPoS)
13
4. Account
16
4.1 Types
16
4.2 Creation
16
4.3 Structure
16
5. Block
18
5.1 Block Header
18
5.1.1 Raw Data
18
5.1.2 Witness Signature
19
5.1.3 Block ID
19
5.2 Transaction
19
5.2.1 Signing
19
5.2.2 Bandwidth Model
19
5.2.3 Fee
20
5.2.4 Transaction as Proof of Stake (TaPoS)
20
5.2.5 Transaction Confirmation
21
5.2.6 Structure
21
6. TRON Virtual Machine (TVM)
23
6.1 Introduction
23
6.2 Workflow
23
6.3 Performance
25
6.3.1 Lightweight Architecture
25
6.3.2 Robust
25
6.3.3 High Compatibility
25
6.3.4 Low Cost
25
7. Smart Contract
26
7.1 Introduction
26
7.2 Energy Model
26
7.3 Deployment
27
2
7.4 Trigger Function
27
7.5 TRON Solidity
27
8. Token
28
8.1 TRC-10 Token
28
8.2 TRC-20 Token
28
8.3 Beyond
29
9. Governance
30
9.1 Super Representative
30
9.1.1 General
30
9.1.2 Election
30
9.1.3 Reward
30
a. Vote Reward
30
b. Block Reward
31
c. Reward Calculation
31
9.2 Committee
32
9.2.1 General
32
9.2.2 Dynamic Network Parameters
32
9.2.3 Create Proposal
36
9.2.4 Vote Proposal
36
9.2.5 Cancel Proposal
36
9.3 Structure
36
10. DApp Development
37
10.1 APIs
37
10.2 Networks
37
10.3 Tools
37
10.4 Resources
37
11. Conclusion
39
3
1. Introduction
1.1 Vision
TRON is an ambitious project dedicated to the establishment of a truly decentralized Internet and its
infrastructure. The TRON Protocol, one of the largest blockchain-based operating systems in the
world, offers public blockchain support of high throughput, high scalability, and high availability for
all Decentralized Applications (DApps) in the TRON ecosystem. The July 2018 acquisition of
BitTorrent further cemented TRON’s leadership in pursuing a decentralized ecosystem.
1.2 Background
The introduction of Bitcoin in 2009 revolutionized society’s perception of the traditional financial
system in the wake of the Great Recession (2007-2008). As centralized hedge funds and banks
collapsed from speculation in opaque financial derivatives, blockchain technology provided a
transparent universal ledger from which anybody could glean transaction information. The
transactions were cryptographically secured using a Proof of Work (PoW) consensus mechanism,
thus preventing double spend issues.
In late 2013, the Ethereum white paper proposed a network in which smart contracts and a
Turing-complete Ethereum Virtual Machine (EVM) would allow developers to interact with the
network through DApps. However, as transaction volumes in Bitcoin and Ethereum peaked in 2017,
it was apparent from the low transaction throughput times and high transaction fees that
cryptocurrencies like Bitcoin and Ethereum in their existing state were not scalable for widespread
adoption. Thus, TRON was founded and envisioned as an innovative solution to these pressing
scalability challenges.
4
1.3 History
The TRON DAO was established in July 2017 in Singapore. In December 2017, TRON had
launched its open source protocol. The Testnet, Blockchain Explorer, and Web Wallet were all
launched by March 2018. TRON Mainnet launched shortly afterward in May 2018, marking the
Odyssey 2.0 release as a technical milestone. In June 2018, TRON declared its independence
with the creation of the Genesis block, along with the July 2018 acquisition of BitTorrent. In
October 2018, TRON launched the TRON Virtual Machine (TVM), a complete developers’ toolset,
and 360 support system. The TRON roadmap involves combining BitTorrent’s 100 million users
with the TRON network via Project Atlas, as well as fostering the developer community to launch
exciting new DApps on the TRON network1.
1 V1.0 is available at https://tron.network/static/doc/white_paper_v_1_0.pdf
5
1.4 Terminology
Address/Wallet
An address or wallet consisting of account credentials on the TRON network are generated by a
key pair, which consists of a private key and a public key, the latter being derived from the former
through an algorithm. The public key is usually used for session key encryption, signature
verification, and encrypting data that could be decrypted by a corresponding private key.
ABI
An application binary interface (ABI) is an interface between two binary program modules; usually
one of these modules is a library or an operating system facility, and the other is a user run
program.
API
An application programming interface (API) is mainly used for user clients development. With API
support, token issuance platforms can also be designed by developers themselves.
Asset
In TRON's documents, asset is the same as token, which is also denoted as TRC-10 token.
Bandwidth Points (BP)
To keep the network operating smoothly, TRON network transactions use BP as fuel. Each account
gets 5000 free daily BP and more can be obtained by freezing TRX for BP. Both TRX and TRC-10
token transfers are normal transactions costing BP. Smart contract deployment and execution
transactions consume both BP and Energy.
Block
Blocks contain the digital records of transactions. A complete block consists of the magic number,
block size, block header, transaction counter, and transaction data.
Block Reward
Block production rewards are sent to a sub-account (address/wallet). Super Representatives can
claim their rewards on Tronscan or through the API directly.
Block Header
A block header is part of a block. TRON block headers contain the previous block’s hash, the
Merkle root, timestamp, version, and witness address.
6
Cold Wallet
Cold wallet, also known as offline wallet, keeps the private key completely disconnected from any
network. Cold wallets are usually installed on "cold" devices (e.g. computers or mobile phones
staying offline) to ensure the security of TRX private key.
DApp
Decentralized Application is an App that operates without a centrally trusted party. An application
that enables direct interaction/agreements/communication between end users and/or resources
without a middleman.
gRPC
gRPC
(gRPC Remote Procedure Calls) is an open source remote procedure call (RPC) system
2
initially developed at Google. It uses HTTP/2 for transport, Protocol Buffers as the interface
description language, and provides features such as authentication, bidirectional streaming and flow
control, blocking or nonblocking bindings, and cancellation and timeouts. It generates
cross-platform client and server bindings for many languages. Most common usage scenarios
include connecting services in microservices style architecture and connecting mobile devices, and
browser clients to backend services.
Hot Wallet
Hot wallet, also known as online wallet, allows user's private key to be used online, thus it could be
susceptible to potential vulnerabilities or interception by malicious actors.
JDK
Java Development Kit is the Java SDK used for Java applications. It is the core of Java
development, comprising the Java application environment (JVM+Java class library) and Java
tools.
KhaosDB
TRON has a KhaosDB in the full-node memory that can store all the newly-forked chains generated
within a certain period of time and supports witnesses to switch from their own active chain swiftly
into a new main chain. See 2.2.2 State Storage for more details.
LevelDB
LevelDB was initially adopted with the primary goal to meet the requirements of fast R/W and rapid
development. After launching the Mainnet, TRON upgraded its database to an entirely customized
one catered to its very own needs. See 2.2.1 Blockchain Storage for more details.
Merkle Root
A Merkle root is the hash of all hashes of all transactions included as part of a block in a blockchain
network. See 3.1 Delegated Proof of Stake (DPoS) for more details.
2
https://en.wikipedia.org/wiki/GRPC
7
Public Testnet (Shasta)
A version of the network running in a single-node configuration. Developers can connect and test
features without worrying about the economic loss. Testnet tokens have no value and anyone can
request more from the public faucet.
RPC
3
In distributed computing, a remote procedure call (RPC) is when a computer program causes a
procedure (subroutine) to execute in a different address space (commonly on another computer on
a shared network), which is coded as if it were a normal (local) procedure call, without the
programmer explicitly coding the details for the remote interaction.
Scalability
Scalability is a feature of the TRON Protocol. It is the capability of a system, network, or process to
handle a growing amount of work or its potential to be enlarged to accommodate that growth.
SUN
SUN replaced drop as the smallest unit of TRX. 1 TRX = 1,000,000 SUN.
Throughput
High throughput is a feature of TRON Mainnet. It is measured in Transactions Per Second (TPS),
namely the maximum transaction capacity in one second.
Timestamp
The approximate time of block production is recorded as Unix timestamp, which is the number of
milliseconds that have elapsed since 00:00:00 01 Jan 1970 UTC.
TKC
Token configuration.
TRC-10
A standard of crypto token on TRON platform. Certain rules and interfaces are required to follow
when holding an initial coin offering on TRON blockchain.
TRX
TRX stands for Tronix, which is the official cryptocurrency of TRON.
3
https://en.wikipedia.org/wiki/Remote_procedure_call
8
2. Architecture
TRON adopts a 3-layer architecture divided into Storage Layer, Core Layer, and Application Layer.
The TRON protocol adheres to Google Protobuf, which intrinsically supports multi-language
extension.
Figure 1: TRON 3-layer Architecture
9
2.1 Core
There are several modules in the core layer, including smart contracts, account management, and
consensus. A stack-based virtual machine is implemented on TRON and an optimized instruction
set is used. In order to better support DApp developers, Solidity
was chosen as the smart contract
4
language, followed by future support of other advanced languages. In addition, TRON's consensus
mechanism is based on Delegated Proof of Stake (DPoS) and many innovations were made in
order to meet its unique requirements.
2.2 Storage
TRON designed a unique distributed storage protocol consisting of Block Storage and State
Storage. The notion of a graph database was introduced into the design of the storage layer to
better meet the need for diversified data storage in the real world.
2.2.1 Blockchain Storage
TRON blockchain storage chooses to use LevelDB, which is developed by Google and proven
successful with many companies and projects. It has high performance and supports arbitrary byte
arrays as both keys and values, singular get, put and delete, batched put and delete, bi-directional
iterators, and simple compression using the very fast Snappy algorithm.
2.2.2 State Storage
TRON has a KhaosDB in the full-node memory that can store all the newly forked chains generated
within a certain period of time and supports witnesses to switch from their own active chain swiftly
into a new main chain. It can also protect blockchain storage by making it more stable from being
terminating abnormally in an intermediate state.
2.3 Application
Developers can create a diverse range of DApps and customized wallets on TRON. Since TRON
enables smart contracts to be deployed and executed, the opportunities of utility applications are
unlimited.
4
Solidity official documentation: https://solidity.readthedocs.io/
10
2.4 Protocol
TRON protocol adheres to Google Protocol Buffers
, which is a language-neutral, platform-neutral,
5
and extensible way of serializing structured data for use in communications protocols, data storage,
and more.
2.4.1 Protocol Buffers
Protocol Buffers (Protobuf) is a flexible, efficient, automated mechanism for serializing structured
data, similar to JSON or XML, but much smaller, faster and simpler.
Protobuf (.proto) definitions can be used to generate code for C++, Java, C#, Python, Ruby,
Golang, and Objective-C languages through the official code generators. Various third-party
implementations are also available for many other languages. Protobuf eases development for
clients by unifying the API definitions and also optimizing data transfers. Clients can take the API
.proto from TRON’s protocol repository and integrate through the automatically-generated code
libraries.
As a comparison, Protocol Buffers is 3 to 10 times smaller and 20 to 100 times faster than XML,
with less ambiguous syntax. Protobuf generates data access classes that are easier to use
programmatically.
2.4.2 HTTP
TRON Protocol provides a RESTful HTTP API alternative to the Protobuf API. They share the same
interface but the HTTP API can be readily used in javascript clients.
2.5 TRON Virtual Machine (TVM)
The TVM is a lightweight, Turing complete virtual machine developed for TRON’s ecosystem. The
TVM connects seamlessly with the existing development ecosystem to provide millions of global
developers with a custom-built blockchain system that is efficient, convenient, stable, secure, and
scalable.
2.6 Decentralized Exchange (DEX)
5
Google Protocol Buffers official documentation: https://developers.google.com/protocol-buffers/
11
The TRON network natively supports decentralized exchange functions. A decentralized exchange
consists of multiple trading pairs. A trading pair (notation “Exchange”) is an Exchange Market
between TRC-10 tokens, or between a TRC-10 token and TRX. Any account can create a trading
pair between any tokens, even if the same pair already exists on the TRON network. Trading and
price fluctuations of the trading pairs follow the Bancor Protocol
. The TRON network stipulates that
6
the weights of the two tokens in all trading pairs are equal, so the ratio of their balances is the price
between them. For example, consider a trading pair containing two tokens, ABC and DEF. ABC has
a balance of 10 million and DEF has a balance of 1 million. Since their weights are equal, 10 ABC =
1 DEF. This means that the ratio of ABC to DEF is 10 ABC per DEF.
2.7 Implementation
The TRON blockchain code is implemented in Java and was originally a fork from EthereumJ.
6
Bancor Protocol official website: https://about.bancor.network/protocol/
12
3. Consensus
3.1 Delegated Proof of Stake (DPoS)
The earliest consensus mechanism is the Proof of Work (PoW) consensus mechanism. This
protocol is currently implemented in Bitcoin
and Ethereum
. In PoW systems, transactions
7
8
broadcast through the network are grouped together into nascent blocks for miner confirmation. The
confirmation process involves hashing transactions using cryptographic hashing algorithms until a
merkle root has been reached, creating a merkle tree:
Figure 2: 8 TRX transactions are hashed into the merkle root. This merkle root is then included in the block header, which
is attached to the previously confirmed blocks to form a blockchain. This allows for easy and transparent tracking of
transactions, timestamps, and other related information.
7
Bitcoin whitepaper: https://bitcoin.org/bitcoin.pdf
8
Ethereum whitepaper: https://github.com/ethereum/wiki/wiki/White-Paper
13
Cryptographic hashing algorithms are useful in network attack prevention because they possess
several properties
:
9
●
Input/Output length size
- The algorithm can pass in an input of any length in size, and
outputs a fixed length hash value.
●
Efficiency
- The algorithm is relatively easy and fast to compute.
●
Preimage resistance
- For a given output
z
, it is impossible to find any input
x
such that
h(x) =
z
. In other words, the hashing algorithm
h(x)
is a one-way function in which only the
output can be found, given an input. The reverse is not possible.
●
Collision resistance
- It is computationally infeasible to find any pairs
x
1
≠ x
2
such that
h(x
1
)
= h(x
2
)
. In other words, the probability of finding two different inputs hashing to the same
output is extremely low. This property also implies
second preimage resistance
.
●
Second preimage resistance
- Given
x
1
, and thus
h(x
1
)
, it is computationally infeasible to
find any
x
2
such that
h(x
1
) = h(x
2
)
. While this property is similar to
collision resistance
, the
property differs in that it is saying an attacker with a given
x
1
will find it computationally
infeasible to find any
x
2
hashing to the same output.
●
Deterministic
- maps each input to one and only one output.
●
Avalanche effect
- a small change in the input results in an entirely different output.
These properties give the cryptocurrency network its intrinsic value by ensuring attacks do not
compromise the network. When miners confirm a block, they are rewarded tokens as a built-in
incentive for network participation. However, as the global cryptocurrency market capitalization
steadily increased, the miners became centralized and focused their computing resources on
hoarding tokens as assets, rather than for network participation purposes. CPU miners gave way to
GPUs, which in turn gave way to powerful ASICs. In one notable study, the total power
consumption of Bitcoin mining has been estimated to be as high as 3 GW
, comparable to Ireland’s
10
power consumption. This same study projected total power consumption to reach 8 GW in the near
future.
To solve the energy waste issue, the Proof of Stake (PoS) consensus mechanism was proposed by
many new networks. In PoS networks, token holders lock their token balances to become block
validators. The validators take turns proposing and voting on the next block. However, the problem
with standard PoS is that validator influence correlates directly to the amount of tokens locked up.
This results in parties hoarding large amounts of the network’s base currency wielding undue
influence in the network ecosystem.
The TRON consensus mechanism uses an innovative Delegated Proof of Stake system in which 27
Super Representatives (SRs) produce blocks for the network. Every 6 hours, TRX account holders
who freeze their accounts can vote for a selection of SR candidates, with the top 27 candidates
deemed the SRs. Voters may choose SRs based on criteria such as projects sponsored by SRs to
9
PAAR, C., PELZL, J.,
Understanding Cryptography: A Textbook for Students and Practitioners
, 2010 ed.
Springer-Verlag Berlin Heidelberg, 2010.
10
https://www.sciencedirect.com/science/article/pii/S2542435118301776
14
increase TRX adoption, and rewards distributed to voters. This allows for a more democratized and
decentralized ecosystem. SRs’ accounts are normal accounts, but their accumulation of votes
allows them to produce blocks. With the low throughput rates of Bitcoin and Ethereum due to their
PoW consensus mechanism and scalability issues, TRON’s DPoS system offers an innovative
mechanism resulting in 2000 TPS compared to Bitcoin’s 3 TPS and Ethereum’s 15 TPS.
The TRON protocol network generates one block every three seconds, with each block awarding 32
TRX to Sup프로젝트로 돌아가기