Calculating Costs

1. Transaction Fee Considerations

Every operation on the Peerplays blockchain requires a small fee to cover the cost of the use of the network and data storage on the chain. These fees can add up so it's best to plan ahead, especially if you'll need to make hundreds or thousands of transactions.
The fees are set individually for every operation. The fees will also change over time due to blockchain governance voting. You can check the current fees using the get_global_properties function, and then calculate your total costs given how many times you'll need to run each operation.
You might do something like the following:
  1. 1.
    Use the get_global_properties function. Copy the whole list of operation IDs/fees from the return.
  2. 2.
    Download the latest copy of the Operation ID mapping.
  3. 3.
    Combine the two lists to get the fee for each operation.
Then you can use your combined list to easily calculate the total transaction costs for what you plan to do. At this time, there is no automated process for generating such a list. Here's an example that you can download to get you started, keeping in mind that the fees may have changed since the writing of this guide.

Download

An example of the combined list of Operation IDs, Operation Names, and their Fees:
Peerplays-Operations.xlsx
13KB
Binary
Peerplays Operations with Fees
PPY has a precision of 5. So the numbers listed in the get_global_properties function are in Satoshi. That is to say, to convert this number to nominal units, a decimal point is added 5 places from the right.
Some examples:
  • "fee": 1000 is really 0.01 PPY.
  • "premium_fee": 250000 is really 2.5 PPY.
  • "membership_lifetime_fee": 500000 is really 5 PPY.

1.1. get_global_properties

This function returns the blockchain’s slowly-changing settings (like the fees for each operation).
This object contains all of the properties of the blockchain that are fixed or that change only once per maintenance interval (daily) such as the current list of witnesses, committee_members, block interval, etc.
return type, namespace, & method
1
global_property_object graphene::wallet::wallet_api::get_global_properties()const
Copied!
Function Call
Return
Calling this function is simple:
In the cli_wallet...
1
get_global_properties
Copied!
The global_property_object is returned:
1
get_global_properties
2
{
3
"id": "2.0.0",
4
"parameters": {
5
"current_fees": {
6
"parameters": [[
7
0,{
8
"fee": 1000,
9
"price_per_kbyte": 1000
10
}
11
],[
12
1,{
13
"fee": 50
14
}
15
],[
16
2,{
17
"fee": 0
18
}
19
],[
20
3,{
21
"fee": "500000000000"
22
}
23
],[
24
4,{}
25
],[
26
5,{
27
"basic_fee": 500,
28
"premium_fee": 250000,
29
"price_per_kbyte": 1000
30
}
31
],[
32
6,{
33
"fee": 100,
34
"price_per_kbyte": 1000
35
}
36
],[
37
7,{
38
"fee": 1000
39
}
40
],[
41
8,{
42
"membership_annual_fee": "500000000000",
43
"membership_lifetime_fee": 500000
44
}
45
]
46
# ... #
47
],
48
"scale": 10000
49
},
50
"block_interval": 3,
51
"maintenance_interval": 3600,
52
"maintenance_skip_slots": 3,
53
"committee_proposal_review_period": 3600,
54
"maximum_transaction_size": 99999,
55
# ... #
56
"extensions": {
57
"betting_rake_fee_percentage": 100,
58
"live_betting_delay_time": 0,
59
"sweeps_distribution_percentage": 200,
60
# ... #
61
}
62
},
63
"next_available_vote_id": 118,
64
"active_committee_members": [
65
# ... #
66
],
67
"active_witnesses": [
68
# ... #
69
],
70
"active_sons": [{
71
# ... #
72
}
73
]
74
}
Copied!
Parts of the example return have been truncated to fit. The actual return is much longer.

1.2. An Example

Let's say you need to make 50,000 NFTs with custom permissions and issue them to various accounts.
To calculate the total cost for this, you'll find the transaction fees for each transaction to accomplish the goal and then multiply by how may times you need to execute each transaction.
Using get_global_properties and the list of operation ID's you find the following transaction fees:
  1. 1.
    Operation #85 -> custom_account_authority_create_operation -> Fee = 1PPY & Kb of Data = 1PPY
  2. 2.
    Operation #92 -> nft_metadata_create_operation -> Fee = 1PPY & Kb of Data = 1PPY
  3. 3.
    Operation #94 -> nft_mint_operation -> Fee = 1PPY & Kb of Data = 1PPY
You will need to create the custom permissions once: 1 PPY (the fee) + 1 PPY (for 1 Kb worth of data). Then you will need to create the NFT metadata once: 1 PPY (the fee) + 1 PPY (for 1 Kb worth of data). Last you will need to mint the 50,000 NFTs, which issues them to the accounts that will ultimately own them: 50,000 PPY (the fee) + 50,000 PPY (for 1 Kb worth of data).
A Kb (Kilobyte) of data can accommodate about 1/2 page worth of text. So unless you have a lot of information to apply to your NFTs, the 1 PPY for a Kb of data should cover most use cases!
When added all together, you get:
1 + 1 + 1 + 1 + 50,000 + 50,000 = 100,004 PPY cost in transaction fees to accomplish your goal.
This could represent 50,000 movie tickets, 50,000 shares of a company, or even 50,000 college degrees!
Remember the 5 "P's"... Proper planning prevents poor performance!
Last modified 3mo ago