Version
Show / Hide Table of Contents

Neo3 Governance API

Economic Model

Inheriting from Neo2, Neo3 employs the dual-token mechanism, where NEO is used for governance and GAS is used for payment.

NEO

NEO has a max supply of 100 million tokens and the smallest unit of 1, or in other words, is not divisible. NEO holders are the owners and managers of the Neo network. By constructing voting transactions on the Neo network, they can exercise management power, such as electing validators, adjusting consensus strategy, adjusting pricing model, etc., and can also claim the corresponding GAS based on the amount of NEO they hold.

GAS

GAS is the fuel token for the realization of Neo network resource control, with a smallest unit of 0.00000001. Users can obtain GAS either through a claim or purchase. When using the Neo network, they need to pay a certain amount of GAS as network fees, such as transfer, registering assets, publishing assets, running DApps, etc.

Native ContractContract Hash
NeoToken 0xf61eebf573ea36593fd43aa150c055ad7906ab83
GasToken 0x70e2301955bf1e74cbb31d18c2f96972abadb328
Policy 0x79bcd398505eb779df6e67e4be6c14cded08e2f2

The way to call the native contract methods is the same as calling other ordinary contracts. Contract.Call(NEO.hash, method, params)

Governance Strategy

Candidate

Function & Scope

There is no duty assigned to candidates. However, committee members and validators are elected from certain number of candidates with most votes. Their relationship can be described in the following picture. There is no explicit relationship between committee members and validators but, as default committee member amount (21) is more than that of validators, generally speaking validators are a subset of committee members.

avatar

How to Become a Candidate

An address can be registered as candidate or unregistered afterwards. Corresponding contract methods are as follows:

MethodParametersFee in GAS
RegisterCandidate UInt160 publicKey0.05
UnregisterCandidate UInt160 publicKey0.05

Registering / unregistering candidate requires signature. It means candidate registering / unregistering is only self-determined.

Candidate Voting

Every address has the right to vote to only one address (whether or not it's a candidate). Candidate's received votes are defined as the sum of NEO held by its voter. Every standby committee member will vote to itself in genesis block.

Voting contract method is as follows. Please not that voter's signature will be checked.

MethodParametersFee in GAS
Vote UInt160 account, byte[] voteTo5

As voters' votes & held NEO, as well as registered candidates keep changing, candidate set and their votes are re-calculated in every block.

Corresponding contract methods

MethodParametersFee in GAS
GetCandidates null1

Committee

Function & Scope

Committee members have the privilege to modify the configuration of Neo network by voting, including:

  • Set the maximum block size

  • Set maximum transactions in a block

  • Set fee per byte for network transmission

  • Block / unblock account

Method definition and corresponding fee are defined in PolicyContract as shown below:

MethodParametersFee in GAS
SetMaxBlockSize uint blockSize0.03
SetMaxTransactionsPerBlock uint maxTransactions0.03
SetFeePerByte long feePerByte0.03
BlockAccount UInt160 account0.03
UnblockAccount UInt160 account0.03

To bring such modification into effect, committee members should send a transaction which calls corresponding method & includes enough signatures on chain. This transaction is executed as long as it's signed by more than half of the committee members.

Furthermore, PolicyContract also supports corresponding reading methods:

MethodParametersFee in GAS
GetMaxBlockSize null0.01
GetMaxTransactionsPerBlock null0.01
GetFeePerByte null0.01
getBlockedAccounts null0.01

How Are Committee Members Elected

  1. Sort the registered candidates by votes

  2. Take certain numbers of candidates (21 by default) with the most votes as committee members.

Committee members will be refreshed every block.

Corresponding Contract method

MethodParametersFee in GASReturn value
GetCommittee null1Current committee members in format of Array<ECPoint>

Validator

Function & Scope

Validators are nodes which are able to start or vote to new block proposals.

How Are Validators Elected

  1. Sort the registered candidates by votes

  2. Take certain numbers of candidates (7 by default) with the most votes as validators.

Similar to committee members, validators will be refreshed every block.

Corresponding Contract method

MethodParametersFee in GASReturn value
getValidators null1Current validators in format of Array<ECPoint>
GetNextBlockValidators null1Validators by persisting block in format of Array<ECPoint>

Token Distribution

Half of total NEO amount, or 50 million tokens are distributed in genesis block to all standby committee members in the following rules:

  1. Get N1 = amount of standby committee members & N2 = amount of standby validators according to protocol.json

  2. Separate 50 million NEO tokens into (N1 + N2) portions and distribute them to all committee members: every non-validator with 1 portion and every validator with 2 portions

  3. Remaining half is distributed to standby validators' multi-signature address

    All interactions in Neo are performed through transactions. Sending a transaction on chain requires paying GAS tokens as fee, including system fee and network fee. System fee will be burnt as resource consumption for transaction execution, while network fee will be distributed to the speaker (the validator who start a new-block proposal) of the block where corresponding transaction is included.

Nep17 Contract method

NEO and GAS are Nep17 contracts. Nep17 contract methods are as follows:

MethodParametersFee in GASResult
name null0Token name in String
symbol null0Token symbol in String
decimals null0.01Token decimals in UInt
TotalSupply null0.01Token total supply in BigInteger
BalanceOf UInt160 account0.01account balance in BigInteger
Transfer UInt160 from, UInt160 to, BigInteger amount0.08Send specified amount of token from Addressfromto Addressto. Please note that it will checkfrom's signature, whether caller isfrom, whethertois payable, whetherfrom's balance is enough
onPersist null0Manually perform actions this Nep17 contract will do upon block persisting
supportedStandards null0Supported NEP standards in String[]

Contract methods by NEO:

MethodParametersFee in GASReturn value
UnclaimedGas UInt160 account0.03unclaimed GAS amount of this address in uint