Node RPC#
You can view node RPC methods here
Default RPC endpoint#
http://localhost:9009
RPC call example#
Address nonce#
Address nonce is a transaction counter in each Idena address. This prevents replay attacks where a transaction sending eg. 20 coins from A to B can be replayed by B over and over to continually drain A's balance. The nonce keeps track of how many transactions the sender has sent during the current epoch. Address nonce starts from 0 each epoch. Nonce is the transaction counter only of the sending address. It doesn't include transactions received by the address.
You can get the current account nonce by calling dna_getBalance method. Example:
Response:
Epoch#
You can get the current epoch using dna_epoch method. Example:
Response:
Transaction nonce and epoch#
When sending transaction the current epoch number and subsequent nonce value should be specified for the sender address (address nonce+1).
Example:
Transaction fees#
The transaction fee is calculated automatically by protocol. The fee goes up or down based on how full the previous block was, targeting an average block utilization of 50%. When the previous block is more than 50% full, the transaction fee goes up proportionally. When it is below 50% usage, fees go down.
You can specify the maximum fee limit for the transaction maxFee.
Dust#
All addresses with balances less than dust are cleaned every time a new epoch starts. Dust coins are burnt to prevent spam and minimize the size of the blockchain state. You can calculate the dust size using the following formula:
The smallest unit of iDNA#
The smallest unit of iDNA is 1e-18 iDNA (0.000000000000000001 iDNA).
Raw transactions#
You can build and sign raw transaction offline. See js examples. Actual protobuf model of transactions see here.