Skip to main content

Governance API

Candidates#

There is no duty assigned to candidates. However, committee members and consensus nodes are elected from certain number of candidates with most votes.

How to Become a Candidate#

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

MethodParametersFee in GAS
RegisterCandidateECPoint publicKeyAdjustable, initially 0.00001
UnregisterCandidateECPoint publicKey0.00065536 (CpuFee)
note

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
VoteUInt160 account, byte[] voteTo0.00065536 (CpuFee)

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

MethodParametersFee in GAS
GetCandidatesnull0

Committee#

Function & Scope#

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

  • Role designation
  • Set fee per byte for network transmission
  • Set execution fee (CpuFee) factor
  • Set storage price
  • Block / unblock account
  • Set Oracle service price
  • Set gas released per block
  • Set fee to register a candidate
  • Add NNS root
  • Set the NNS registration/renewal fee
  • Update the NNS contract
  • Set minimum fee for contract deployment

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

MethodParametersFee in GASContract
DesignateAsRoleRole role, ECPoint[] nodes0.00032768 (CpuFee)RoleManagement
SetFeePerBytelong value0.00032768 (CpuFee)PolicyContract
SetExecFeeFactoruint value0.00032768 (CpuFee)PolicyContract
SetStoragePriceuint value0.00032768 (CpuFee)PolicyContract
SetPricelong price0.00032768 (CpuFee)OracleContract
SetGasPerBlockBigInteger gasPerBlock0.00032768 (CpuFee)NeoToken
SetRegisterPricelong registerPrice0.00032768 (CpuFee)NeoToken
AddRootstring root0.00032768 (CpuFee)NameService
SetPricelong price0.00032768 (CpuFee)NameService
UpdateByteString nef, string manifestStoragePrice * (nefFile.Length + manifest.Length)NameService
SetMinimumDeploymentFeeBigInteger value0.00032768 (CpuFee)ContractManagement

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, corresponding reading methods are also supported:

MethodParametersFee in GASContract
GetDesignatedByRoleRole role, uint index0.00032768 (CpuFee)RoleManagement
GetFeePerBytenull0.00032768 (CpuFee)PolicyContract
GetExecFeeFactornull0.00032768 (CpuFee)PolicyContract
GetStoragePricenull0.00032768 (CpuFee)PolicyContract
IsBlockedUInt160 account0.00032768 (CpuFee)PolicyContract
GetPricenull0.00032768 (CpuFee)OracleContract
GetGasPerBlocknull0.00032768 (CpuFee)NeoToken
GetRegisterPricenull0.00032768 (CpuFee)NeoToken
GetMinimumDeploymentFeenull0.00032768 (CpuFee)ContractManagement

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 are refreshed every 21 blocks.

Corresponding contract method#

MethodParametersFee in GASReturn value
GetCommitteenull0.04194304 (CpuFee)Current committee members in format of ECPoint[]

Consensus Nodes#

Function & Scope#

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

How are consensus nodes elected#

  1. Sort the registered candidates by votes
  2. Take certain numbers of candidates (7 by default) with the most votes as consensus nodes. Similar to committee members, consensus nodes are refreshed every 21 blocks.

Corresponding contract method#

MethodParametersFee in GASReturn value
GetNextBlockValidatorsnull0.04194304 (CpuFee)Consensus nodes by persisting block in format of ECPoint[]

Token Distribution#

Total NEO amount, or 100 million tokens are distributed in genesis block to standby consensus nodes' 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 consensus node who starts 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
symbolnull0Token symbol in String
decimalsnull0Token decimals in UInt
TotalSupplynull0.00032768 (CpuFee)Token total supply in BigInteger
BalanceOfUInt160 account0.00032768 (CpuFee)account balance in BigInteger
TransferUInt160 from, UInt160 to, BigInteger amount0.00131072 (CpuFee) + 0.0000005 (StorageFee)Send specified amount of token from Address from to Address to. Please note that it will check from's signature, whether caller is from, whether to is payable, whether from's balance is enough

Contract methods by NEO:

MethodParametersFee in GASReturn value
UnclaimedGasUInt160 account0.00131072 (CpuFee)unclaimed GAS amount of this address in uint