Skip to main content
Version: v4.0.0

Protobuf Documentation

Purpose

This module is designed to calculate an inflation rewards each years based on static params. Each block rewards is the same over the year.

🧮 Calculation

The initial inflation is set to 15%, annual_provisions and target_supply will set at the beginning of the chain (on the first block). It's based on the initial total supply. For example, with a total supply of 200M token, annual_provisions will be configured to 30M and target_supply 230M.

At the end of the year (the last block of the year, to be more precise), due to rounding imprecision, if the distributed tokens for the last block of the year added with the actual tokens total supply is bigger than the target_supply, only the difference to reach the target_supply will be minted. Conversely, in some case, due to rounding also, the target_supply is not reached at the last block, but at the next block.

The new inflation, annual_provisions and target_supply is recalculated at the next block after the block that reach the target_supply. To calculate the new inflation, get the current inflation multiplied by (1 - annual_reduction_factor), then the new annual_provisions and target_supply is deducted based on the current total supply (that is the old target_supply)

Table of Contents

Top

mint/v1beta1/mint.proto

Minter

Minter represents the minting state.

At the beginning of the chain (first block) the mint module will recalculate the annual_provisions and target_supply based on the genesis total token supply and the inflation configured. By default inflation is set to 15%. If the genesis total token supply is 200M token, the annual_provision will be 30M and target_supply 230M.

FieldTypeLabelDescription
inflationstringcurrent annual inflation rate
annual_provisionsstringcurrent annual expected provisions
target_supplystringtarget supply at end of period

Params

Params holds parameters for the mint module.

Configure the annual reduction factor will update at the each end of year the new token distribution rate by reducing the actual inflation by the annual_reduction_factor configured. By default, annual_reduction_factor is 20%. For example, with an initial inflation of 15%, at the end of the year, new inflation will be 12%.

FieldTypeLabelDescription
mint_denomstringtype of coin to mint
annual_reduction_factorstringannual reduction factor inflation rate change
blocks_per_yearuint64expected blocks per year

Top

mint/v1beta1/genesis.proto

GenesisState

GenesisState defines the mint module's genesis state.

FieldTypeLabelDescription
minterMinterminter is a space for holding current inflation information.
paramsParamsparams defines all the paramaters of the module.

Top

mint/v1beta1/query.proto

QueryAnnualProvisionsRequest

QueryAnnualProvisionsRequest is the request type for the Query/AnnualProvisions RPC method.

QueryAnnualProvisionsResponse

QueryAnnualProvisionsResponse is the response type for the Query/AnnualProvisions RPC method.

FieldTypeLabelDescription
annual_provisionsbytesannual_provisions is the current minting annual provisions value.

QueryInflationRequest

QueryInflationRequest is the request type for the Query/Inflation RPC method.

QueryInflationResponse

QueryInflationResponse is the response type for the Query/Inflation RPC method.

FieldTypeLabelDescription
inflationbytesinflation is the current minting inflation value.

QueryParamsRequest

QueryParamsRequest is the request type for the Query/Params RPC method.

QueryParamsResponse

QueryParamsResponse is the response type for the Query/Params RPC method.

FieldTypeLabelDescription
paramsParamsparams defines the parameters of the module.

Query

Query provides defines the gRPC querier service.

Method NameRequest TypeResponse TypeDescriptionHTTP VerbEndpoint
ParamsQueryParamsRequestQueryParamsResponseParams returns the total set of minting parameters.GET/cosmos/mint/v1beta1/params
InflationQueryInflationRequestQueryInflationResponseInflation returns the current minting inflation value.GET/cosmos/mint/v1beta1/inflation
AnnualProvisionsQueryAnnualProvisionsRequestQueryAnnualProvisionsResponseAnnualProvisions current minting annual provisions value.GET/cosmos/mint/v1beta1/annual_provisions

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)