Cronos POS Chain Docs
  • Getting Started
    • 📑Cronos POS Chain Introduction
    • 🔰Architecture
  • For USERS
    • 🌟New brand and domains
    • 💰Wallets
      • chain-maind
      • Ledger Hardware Wallets with chain-maind
      • Crypto.com DeFi Desktop Wallet
      • Conducting IBC Transfer with Keplr Wallet
      • Using Ledger Device with Keplr Wallet
      • Mainnet Address Generation
      • Mainnet Address Verification
      • Multisig Account
      • Delegation Guide
      • Key Principles for Wallet Security
    • 🛠️Token Migration Web Tool
    • 🚰Croeseid Testnet Faucet
  • For Node Hosts
    • ⛓️Running Nodes
      • Public Node Sync
      • Quicksync
      • Cronos POS Chain Mainnet: Running a Full Node
        • Upgrade Guide
          • The "V5" upgrade guide (v4.* to v5.0.1) :
          • The "V4" upgrade guide (v3.* to v4.2.2) :
          • The "DRACO II" upgrade guide (v2.* to v3.3.2) :
          • The "Canis Major" upgrade guide (v1.* to v2.0.1) at block height 922,363:
          • Running "Canis Major" network upgrade with cosmovisor
      • Cronos POS Chain Mainnet: Running a Validator
      • Cronos POS Chain Mainnet Validator Security Checklist
      • Croeseid Testnet: Running Nodes
      • Mainnet/Testnet: Running Nodes using AWS 1-click Deployment
      • Mainnet/Testnet: Running Nodes using Azure 1-click Deployment
      • Croeseid Testnet: Running Nodes With Nix
      • Devnet: Running Latest Development Node
    • 🔄Advanced TMKMS Integration
    • 💫Notes on Performance
    • 🔃Notes on Production Deployment
  • Block Explorers
    • 📊Cronos POS Chain Mainnet Explorer
    • 📊Croeseid Testnet Explorer
  • Cronos PoS Chain Protocol
    • ⛓️Chain Details
      • Genesis
      • Protocol Documentation
      • Chain ID, Address Format and Signatures
      • Create the IBC-enabled tokens on the Cronos POS Chain with Solo Machine
      • List of parameters
      • Proposal Process
      • Technical glossary
    • 🎛️Modules
      • module_supply
      • module_slashing
      • module_authz
      • module_bank
      • module_mint
      • module_gov
      • module_staking
      • module_distribution
      • module_nft
  • Cronos PoS Integration
    • 🔄Integration documentation
    • 🛂Node Setup and RPC node
    • 🔲Blocks and Transactions
Powered by GitBook
On this page
  • Table of Content
  • Common APIs
  • Tendermint
  • Common APIs
  • Tendermint
  • 1. Tendermint Block API
  • 2. Tendermint Block Results API
  • Cosmos
  • 3. Cosmos Transaction Query API
  • 4. Cosmos Transaction Search API
  • Common Block Details
  • 1. Mint
  • 2. Block Rewards
  • 3. Proposer Rewards
  • 4. Commissions
  • Common Transaction Details
  • 1. Block Height
  • 2. Transaction Hash
  • 3. Transaction Fee
  • 4. Assets and Amount
  • Bank
  • 1. MsgSend
  • 2. MsgMultiSend
  • Distribution
  • 1. MsgSetWithdrawAddress
  • 2. MsgWithdrawDelegatorReward
  • 3. MsgWithdrawValidatorCommission
  • 4. MsgFundCommunityPool
  • Staking
  • 1. MsgCreateValidator
  • 2. MsgEditValidator
  • Details
  • 3. MsgDelegate
  • 4. MsgBeginRedelegate
  • 5. MsgUndelegate
  • 5a. Upon MsgUndelegate completed
  • Slashing
  • 1. MsgUnjail
  • 2. Being Jailed and Slashed
  • Governance
  • 1. MsgSubmitProposal
  • 1a. Community Pool Spend Proposal
  • 2. MsgDeposit
  • 2a. Burn Proposal's Deposit if Proposal does not Get Enough Deposit
  • 2b. Return Proposal's Deposit
  • 2c. Burn Proposal's Deposit
  • 3. MsgVote
  • 4. Proposal Result
  • Appendix: Module Accounts on Mainnet
  1. Cronos PoS Integration

Blocks and Transactions

PreviousNode Setup and RPC node

Last updated 24 days ago

This document describes the block and transaction structure of the Cronos POS Chain and explains different ways to extract and parse the details of them.

Table of Content

Common APIs

Tendermint

Common APIs

Tendermint

1. Tendermint Block API

  • This API returns block details, a list of transaction bytes and consensus commits.

2. Tendermint Block Results API

  • This API returns the events of the block. These events include the outcomes from transactions, and block changes such as block rewards minted ("mint") and distributed as well as consensus state updates such as validator missing block counts ("liveness")

Cosmos

3. Cosmos Transaction Query API

  • This API returns the parsed transaction details and events of a particular transaction hash

4. Cosmos Transaction Search API

  • This API support event-based query and returns parsed transactions. Common events include:

Event
Description
Example

tx.height

Transaction(s) in a particular block

message.module & message.action

Search for messages belonged to a particular module and actions. Note that this index will degrade when more transaction of its kind grows in number

message.sender

Search for message with particular signer

Note:

  1. The API supports pagination, make sure you have iterate all the pages pagination.offset=[offset starting from 0]&pagination.limit=[record per page]

  2. The performance will degrade if you are searching for a result set that will grow over time. For example, if we search for events that grow with the block height, such as validator's reward distrubtion.

  3. Multiple events in a single search are queried by AND condition. i.e If you do tx.height and message.sender. It will search for transactions that happened on that particular block height AND signed by the sender.

Common Block Details

Usage example:

$ git clone https://github.com/calvinaco/cosmos-api-tools
$ cd cosmos-api-tools
$ node block-results-decoder.js "https://rpc.mainnet.crypto.org/block_results?height=10000"

Note that when you integrate with the API you should still base64 decode the attributes programmatically.

1. Mint

To get the minted token every block:

Accessor
Type

Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].value) where Base64Decode(result.begin_block_events[event_index].type) === "mint" && Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].key) === "amount"

2. Block Rewards

In every block, mint tokens and transaction fees are distributed to every active validator in the network. As a result, there will be multiple events, each corresponding to a validator and the rewards it receives.

To get the reward per validator:

Detail
Accessor
Type

Validator Address

Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].value) where Base64Decode(result.begin_block_events[event_index].type) === "rewards" && Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].key) === "validator"

Reward Amount

Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].value) where Base64Decode(result.begin_block_events[event_index].type) === "rewards" && Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].key) === "amount"

String

3. Proposer Rewards

Detail
Accessor
Type

Validator Address

Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].value) where Base64Decode(result.begin_block_events[event_index].type) === "proposer_reward" && Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].key) === "validator"

Reward Amount

Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].value) where Base64Decode(result.begin_block_events[event_index].type) === "proposer_reward" && Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].key) === "amount"

String

4. Commissions

To get the commission received by each validator:

Detail
Accessor
Type

Validator Address

Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].value) where Base64Decode(result.begin_block_events[event_index].type) === "rewards" && Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].key) === "validator"

Commission Amount

Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].value) where Base64Decode(result.begin_block_events[event_index].type) === "rewards" && Base64Decode(result.begin_block_events[event_index].attributes[attribute_index].key) === "amount"

String

Common Transaction Details

1. Block Height

2. Transaction Hash

3. Transaction Fee

4. Assets and Amount

There are mainly two types of assets and amount representation:

1. Single object

This is commonly seen in staking module but may appear in other modules as well. It represents a single token type.

Example

{
  "denom": "basecro",
  "amount": "10000"
}

where denom is the asset type and amount is the amount and basecro is the basic unit of CRO token (where 10^8 basecro = 1 cro)

2. Array

This is commonly seen in most message types. It represents a list of tokens.

Example:

[
  {
    "denom": "basecro",
    "amount": "10000"
  },
  {
    "denom": "apple",
    "amount": "1000"
  }
]

3. String

This is commonly seen in events' attributes of block and transaction.

Example:

{
  "key": "amount",
  "value": "1234basecro,5678apple"
}

Bank

1. MsgSend

  • Descriptions: Simple transfer message

  • Funds movement: Yes

Protobuf Structure

type MsgSend struct {
	FromAddress string                                   `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty" yaml:"from_address"`
	ToAddress   string                                   `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty" yaml:"to_address"`
	Amount      github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
}

Example

Details

Detail
Accessor
Type

Transaction Type

tx.body.messages[message_index]["@type"] === "/cosmos.bank.v1beta1.MsgSend"

String

From address

tx.body.messages[message_index].from_address

String

To address

tx.body.messages[message_index].to_address

String

Amount

tx.body.messages[message_index].amount

2. MsgMultiSend

  • Descriptions: Multiple inputs, multiple outputs transfer message.

  • Funds movement: Yes

Protobuf

type MsgMultiSend struct {
	Inputs  []Input  `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs"`
	Outputs []Output `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs"`
}
type Input struct {
	Address string                                   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Coins   github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"`
}
type Output struct {
	Address string                                   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Coins   github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"`
}

Example

Details

Detail
Accessor
Type

Transaction Type

tx.body.messages[message_index]["@type"] === "/cosmos.bank.v1beta1.MsgMultiSend"

String

From Addresses

tx.body.messages[message_index].inputs[m].address where m>=1. There can be multiple (m) from addresses.

String

From Amounts

tx.body.messages[message_index].inputs[m].coins where m>=1. There can be multiple (m) from addresses and their corresponding input amount.

To Addresses

tx.body.messages[message_index].outputs[n].address where n>=1. There can be multiple (n) destination addresses.

String

To Amounts

tx.body.messages[message_index].outputs[n].coins where n>=1. There can be multiple (n) destination addresses and their corresponding input amount.

Distribution

1. MsgSetWithdrawAddress

  • Descriptions: Sets the withdraw address for a delegator (or validator self-delegation)

  • Funds movement: No (Pay for fee only)

Protobuf

type MsgSetWithdrawAddress struct {
	DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"`
	WithdrawAddress  string `protobuf:"bytes,2,opt,name=withdraw_address,json=withdrawAddress,proto3" json:"withdraw_address,omitempty" yaml:"withdraw_address"`
}

Example

Details

TODO

2. MsgWithdrawDelegatorReward

  • Descriptions: Withdraw delegation rewards from a single validator

  • Funds movement: Yes

Protobuf

type MsgWithdrawDelegatorReward struct {
	DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"`
	ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"`
}

Example

Details

Detail
Accessor
Type

Transaction Type

tx.body.messages[message_index]["@type"] === "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"

String

Delegator

tx.body.messages[message_index].delegator_address

String

Withdraw From Validator

tx.body.messages[message_index].validator_address

String

Withdraw To Address

tx_response.logs[message_index].events[event_index].attributes[attribute_index].value where tx_response.logs[message_index].events[event_index].type === "transfer" && tx_response.logs[message_index].events[event_index].attributes[attribute_index].key === "recipient".

String

Withdraw Reward Amount

tx_response.logs[message_index].events[event_index].attributes[attribute_index].value where tx_response.logs[message_index].events[event_index].type === "transfer" && tx_response.logs[message_index].events[event_index].attributes[attribute_index].key === "amount".

3. MsgWithdrawValidatorCommission

  • Descriptions: : Withdraws the full commission of a validator to the validator creator (initial delegator) address.

  • Funds movement: Yes

Protofbuf

type MsgWithdrawValidatorCommission struct {
	ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"`
}

Example

  • Message Index: 1

Details

This transaction will trigger an internal transfer from the "Distribution" module account to the withdraw to address. Note that the "Distribution" module account is an internal account in Cronos POS Chain to hold the rewards, commissions and community pool funds before they are being distributed.

Detail
Accessor
Type

Transaction Type

tx.body.messages[message_index]["@type"] === "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"

String

Validator

tx.body.messages[message_index].validator_address

String

Withdraw From Validator

tx.body.messages[message_index].validator_address

String

Withdraw To Address

tx_response.logs[message_index].events[event_index].attributes[attribute_index].value where tx_response.logs[message_index].events[event_index].type === "transfer" && tx_response.logs[message_index].events[event_index].attributes[attribute_index].key === "recipient".

String

Withdraw Commission Amount

tx_response.logs[message_index].events[event_index].attributes[m].value where tx_response.logs[message_index].events[event_index].type === "transfer" && tx_response.logs[message_index].events[event_index].attributes[attribute_index].key === "amount".

4. MsgFundCommunityPool

  • Descriptions: : Fund from an account to the community pool. The community pool can later be sent to another by submitting a MsgSubmitEcProposal

  • Funds movement: Yes

Protobuf

type MsgFundCommunityPool struct {
	Amount    github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
	Depositor string                                   `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"`
}

Example: A transaction funding the community pool

Details

This transaction will initiate a transfer from an account to the "Distribution" module account. Note that the "Distribution" module account is an internal account in Cronos POS Chain to hold the rewards, commissions and community pool funds before they are being distributed.

Detail
Accessor
Type

Transaction Type

tx.body.messages[message_index]["@type"] === "/cosmos.distribution.v1beta1.MsgFundCommunityPool"

String

Deposit From Account

tx.body.messages[message_index].depositor

String

Deposit Amount

tx.body.messages[message_index].amount

Delegate To Address ("Distribution" module account)

tx_response.logs[message_index].events[event_index].attributes[attribute_index].value where tx_response.logs[message_index].events[event_index].type === "transfer" && tx_response.logs[message_index].events[event_index].attributes[attribute_index].key === "recipient".

String

Staking

1. MsgCreateValidator

  • Descriptions: : Create a new validator

  • Funds movement: Yes

Protobuf

type MsgCreateValidator struct {
	Description       Description                            `protobuf:"bytes,1,opt,name=description,proto3" json:"description"`
	Commission        CommissionRates                        `protobuf:"bytes,2,opt,name=commission,proto3" json:"commission"`
	MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation" yaml:"min_self_delegation"`
	DelegatorAddress  string                                 `protobuf:"bytes,4,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"`
	ValidatorAddress  string                                 `protobuf:"bytes,5,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"`
	Pubkey            *types.Any                             `protobuf:"bytes,6,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
	Value             types1.Coin                            `protobuf:"bytes,7,opt,name=value,proto3" json:"value"`
}

type Description struct {
	// moniker defines a human-readable name for the validator.
	Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"`
	// identity defines an optional identity signature (ex. UPort or Keybase).
	Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"`
	// website defines an optional website link.
	Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"`
	// security_contact defines an optional email for security contact.
	SecurityContact string `protobuf:"bytes,4,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty" yaml:"security_contact"`
	// details define other optional details.
	Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"`
}

type CommissionRates struct {
	// rate is the commission rate charged to delegators, as a fraction.
	Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"`
	// max_rate defines the maximum commission rate which validator can ever charge, as a fraction.
	MaxRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=max_rate,json=maxRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_rate" yaml:"max_rate"`
	// max_change_rate defines the maximum daily increase of the validator commission, as a fraction.
	MaxChangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=max_change_rate,json=maxChangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_change_rate" yaml:"max_change_rate"`
}

Example

Details

Detail
Accessor
Type

Transaction Type

tx.body.messages[message_index]["@type"] === "/cosmos.staking.v1beta1.MsgCreateValidator"

String

Initial Delegator Address (Validator Creator)

tx.body.messages[message_index].delegator_address

String

Delegated Amount

`tx.body.messages[message_index].value

2. MsgEditValidator

  • Descriptions: Edit and existing validator

  • Funds Movement: No (Pay for fee only)

Protobuf

type MsgEditValidator struct {
	Description      Description `protobuf:"bytes,1,opt,name=description,proto3" json:"description"`
	ValidatorAddress string      `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"address"`
	// We pass a reference to the new commission rate and min self delegation as
	// it's not mandatory to update. If not updated, the deserialized rate will be
	// zero with no way to distinguish if an update was intended.
	// REF: #2373
	CommissionRate    *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=commission_rate,json=commissionRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"commission_rate,omitempty" yaml:"commission_rate"`
	MinSelfDelegation *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation,omitempty" yaml:"min_self_delegation"`
}

type Description struct {
	// moniker defines a human-readable name for the validator.
	Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"`
	// identity defines an optional identity signature (ex. UPort or Keybase).
	Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"`
	// website defines an optional website link.
	Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"`
	// security_contact defines an optional email for security contact.
	SecurityContact string `protobuf:"bytes,4,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty" yaml:"security_contact"`
	// details define other optional details.
	Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"`
}

Example

Details

TODO

3. MsgDelegate

  • Descriptions: Perform a delegation of coins from a delegator to a validator

  • Funds movement: Yes

Protobuf

type MsgDelegate struct {
	DelegatorAddress string      `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"`
	ValidatorAddress string      `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"`
	Amount           types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
}

Example

Details

Detail
Accessor
Type

Transaction Type

tx.body.messages[message_index]["@type"] === "/cosmos.staking.v1beta1.MsgDelegate"

String

Delegate From Address

tx.body.messages[message_index].delegator_address

String

Delegate To Validator

tx.body.messages[message_index].validator_address

String

Delegate Amount

tx.body.messages[message_index].amount

4. MsgBeginRedelegate

  • Descriptions: Perform a redelegation of coins from a delegator and source validator to a destination validator.

    Note that the redelegation is just a record update of the internal state of a delegator's staked funds. The delegator account won't have any funds movement based on the redelegation except.

    There is a side effect of MsgBeginRedelegate, upon successful execution of this message, all the rewards of the delegator from the previous (source) validator will be withdrawn automatically to the delegator account.

  • Funds movement: Yes

Protobuf

type MsgBeginRedelegate struct {
	DelegatorAddress    string      `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"`
	ValidatorSrcAddress string      `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty" yaml:"validator_src_address"`
	ValidatorDstAddress string      `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty" yaml:"validator_dst_address"`
	Amount              types1.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"`
}

Example

Details

Detail
Accessor
Type

Transaction Type

tx.body.messages[message_index]["@type"] === "/cosmos.staking.v1beta1.MsgBeginRedelegate"

String

Redelegate From Address

tx.body.messages[message_index].delegator_address

String

Redelegate From Validator

tx.body.messages[message_index].validator_src_address

String

Redelegate To Validator

tx.body.messages[message_index].validator_dst_address

String

Redelegate Amount

tx.body.messages[message_index].amount

Auto Withdraw Rewards To Address #

tx_response.logs[message_index].events[event_index].value where tx_response.logs[message_index].events[event_index].type === "transfer" && tx_response.logs[message_index].events[event_index].attributes[attribute_index].key === "recipient".

String

Auto Withdraw Rewards From Address (Always the "distribution" module account) #

tx_response.logs[message_index].events[event_index].value where tx_response.logs[message_index].events[event_index].type === "transfer" && tx_response.logs[message_index].events[event_index].attributes[attribute_index].key === "sender".

String

Auto Withdraw Rewards Amount #

tx_response.logs[message_index].events[event_index].value where tx_response.logs[message_index].events[event_index].type === "transfer" && tx_response.logs[message_index].events[event_index].attributes[attribute_index].key === "amount".

String

Note: There may be multiple auto reward withdrawals that happen. In such a case, the transfer event will have multiple {"recipient":"","sender":"","amount":""}. An example is

{
  "type": "transfer",
  "attributes": [
    {
      "key": "recipient",
      "value": "cro1hr6wx9mm6ycjr4x2p4ek4c9fl2prkxsx79y5qu"
    },
    {
      "key": "sender",
      "value": "cro1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8lyv94w"
    },
    {
      "key": "amount",
      "value": "30763basecro"
    },
    {
      "key": "recipient",
      "value": "cro1hr6wx9mm6ycjr4x2p4ek4c9fl2prkxsx79y5qu"
    },
    {
      "key": "sender",
      "value": "cro1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8lyv94w"
    },
    {
      "key": "amount",
      "value": "6881basecro"
    }
  ]
}

5. MsgUndelegate

  • Descriptions: Perform an undelegation from a delegate and a validator.

  • Funds movement: Yes

Protobuf

type MsgUndelegate struct {
	DelegatorAddress string      `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"`
	ValidatorAddress string      `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"`
	Amount           types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
}

Example

Details

Detail
Accessor
Type

Transaction Type

tx.body.messages[message_index]["@type"] === "/cosmos.distribution.v1beta1.MsgFundCommunityPool"

String

Undelegate From Address

tx.body.messages[message_index].delegator_address

String

Undelegate From Validator

tx.body.messages[message_index].validator_src_address

String

Undeleate Amount

tx.body.messages[message_index].amount

Auto Withdraw Rewards To Address #

tx_response.logs[message_index].events[event_index].value where tx_response.logs[message_index].events[event_index].type === "transfer" && tx_response.logs[message_index].events[event_index].attributes[attribute_index].key === "recipient".

String

Auto Withdraw Rewards From Address (Always the "distribution" module account) #

tx_response.logs[message_index].events[event_index].value where tx_response.logs[message_index].events[event_index].type === "transfer" && tx_response.logs[message_index].events[event_index].attributes[attribute_index].key === "sender".

String

Auto Withdraw Rewards Amount #

tx_response.logs[message_index].events[event_index].value where tx_response.logs[message_index].events[event_index].type === "transfer" && tx_response.logs[message_index].events[event_index].attributes[attribute_index].key === "amount".

String

Note: Similar to MsgBeginRedelegate, there may be multiple auto reward withdrawals happen. In such a case the transfer event will have the multiple {"recipient":"","sender":"","amount":""}

5a. Upon MsgUndelegate completed

  • Descriptions: The undelegation is completed on the first block after the "Unbond Completion Time", in which there will be a special event in the Tendermint Block Results API.

  • Funds movement: Yes

Example

Details

Detail
Accessor
Type

Undelegate From Validator

.result.end_block_events[event_index].attributes[attribute_index].value where .result.end_block_events[event_index].type === "complete_unbonding" && .result.end_block_events[event_index].attributes[attribute_index].key === "validator".

String

Undelegate To Address

.result.end_block_events[event_index].attributes[attribute_index].value where .result.end_block_events[event_index].type === "complete_unbonding" && .result.end_block_events[event_index].attributes[attribute_index].key === "delegator".

String

Undeleate Amount

.result.end_block_events[event_index].attributes[attribute_index].value where .result.end_block_events[event_index].type === "complete_unbonding" && .result.end_block_events[event_index].attributes[attribute_index].key === "amount".

Slashing

1. MsgUnjail

  • Descriptions: : Unjail a validator

  • Funds movement: No (Pay for fee only)

Protobuf

type MsgUnjail struct {
	ValidatorAddr string `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3" json:"address" yaml:"address"`
}

Example

Details

TODO

2. Being Jailed and Slashed

A validator can get jailed for two reasons:

  1. Liveness

  2. Double sign

Liveness

Liveness issue occurs when the validator fails to sign 50%* of the blocks in a 5000# blocks sliding window.

Upon a validator committing a liveness issue, the validator is jailed for 24 hours (85400 seconds#).

Double Sign

Double sign occurs when a validator attempts to provide multiple signatures of the same block height.

This is considered as a serious fault and upon committing the validator will get jailed forever and get slashed for 5% of the total staking#.

This slashing is applied to all the delegations (both self delegation and delegation from other accounts).

Limitations

There is a limitation in the protocol that the slashing amount cannot be easily extracted right now. Theoretically one could calculate the slashed amount of each delegator by applying the slash rate and delegation proportion but in practice small precision issues may be introduced in the calculation process and introduce discrepancies with the chain, so it is not recommended to do so.

On the other hand, the slashed amount, similar to the block rewards and commission, is not deducted from delegator account directly. There are events to signal the jail and slashing occurs but it serve more of the purpose of describing such as event occurs only.

Details - Params

Detail
Category
Accessor
Type

Signing window size (in Blocks)

Liveness

.params.signed_blocks_window

String

Minimum # of blocks to sign in the window

Liveness

.params.min_signed_per_window

String

How long to jail

Liveness

.params.downtime_jail_duration

String (Duration)

Slashing ratio

Liveness

.params.slash_fraction_downtime

String

Slashing ratio

Double Sign

.params.slash_fraction_double_sign

String

Details - Jail and Slash events

Detail
Category
Accessor
Type

Jail

Liveness, Double Sign

.results.begin_block_events[event_index].type === "slash" && Base64Decode(.results.begin_block_events[event_index].attributes[attribute_index].key) === "jailed"

Assertion

Jailed Reason

Liveness

Base64Decode(.results.begin_block_events[event_index].attributes[attribute_index].value === "missing_signature" where .results.begin_block_events[event_index].type === "slash" && Base64Decode(.results.begin_block_events[event_index].attributes[attribute_index].key) === "reason"

String

Jailed Reason

Double Sign

Base64Decode(.results.begin_block_events[event_index].attributes[attribute_index].value === "double_sign" where .results.begin_block_events[event_index].type === "slash" && Base64Decode(.results.begin_block_events[event_index].attributes[attribute_index].key) === "reason"

String

Jailed Validator Address

Liveness, Double Sign

Base64Decode(.results.begin_block_events[event_index].attributes[attribute_index].value) where .results.begin_block_events[event_index].type === "slash" && Base64Decode(.results.begin_block_events[event_index].attributes[attribute_index].key) === "jailed"

String

Slashed Validator Address

Liveness, Double Sign

Base64Decode(.results.begin_block_events[event_index].attributes[attribute_index].value) where .results.begin_block_events[event_index].type === "slash" && Base64Decode(.results.begin_block_events[event_index].attributes[attribute_index].key) === "address"

String

Liveness Event Example

{
  "type": "slash",
  "attributes": [
    {
      "key": "address",
      "value": "crocnclcons1hv2qumdxjeekgtmmnjvzx7ukv7uhlh29w8a4tx",
      "index": true
    },
    {
      "key": "power",
      "value": "4284179",
      "index": true
    },
    {
      "key": "reason",
      "value": "missing_signature",
      "index": true
    },
    {
      "key": "jailed",
      "value": "crocnclcons1hv2qumdxjeekgtmmnjvzx7ukv7uhlh29w8a4tx",
      "index": true
    }
  ]
}

Double Sign Event Example

{
	"type": "slash",
	"attributes": [
		{
			"key": "address",
			"value": "crocnclcons1kf8994z2h49u7ldh6e96mlhw6wjqx4lr4929sc",
			"index": true
		},
		{
			"key": "power",
			"value": "6524600",
			"index": true
		},
		{
			"key": "reason",
			"value": "double_sign",
			"index": true
		}
	]
},
{
	"type": "slash",
	"attributes": [
		{
			"key": "jailed",
			"value": "crocnclcons1kf8994z2h49u7ldh6e96mlhw6wjqx4lr4929sc",
			"index": true
		}
	]
}

Governance

1. MsgSubmitProposal

Submit proposal

Initial deposit will transfer from the proposer account to the "gov" module account.

Funds movement: Yes

Protobuf

type MsgSubmitProposal struct {
	Content        *types.Any                               `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
	InitialDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"initial_deposit" yaml:"initial_deposit"`
	Proposer       string                                   `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"`
}

Example

Details

Detail
Accessor
Type

Transaction Type

tx.body.messages[message_index]["@type"] === "/cosmos.gov.v1beta1.MsgSubmitProposal"

String

Deposit From Address

tx.body.messages[message_index].porposer

String

Deposit Amount

tx.body.messages[message_index].initial_deposit

1a. Community Pool Spend Proposal

After a proposal of this kind is passed, it will release the funds to the grants recipient account.

Community Pool Spend Proposal Transaction

Detail
Accessor
Type

Proposal Type

tx.body.messages[message_index].content["@type"] === "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"

String

Grants Recipient Address

tx.body.messages[message_index].conbtent.recipient

String

Spend Amount

tx.body.messages[message_index].content.amount

Example of Community Pool Spend Proposal transaction:

{
  "tx": {
    "body": {
      "messages": [
        {
          "@type": "/cosmos.gov.v1beta1.MsgSubmitProposal",
          "content": {
            "@type": "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal",
            "title": "Test Community Pool Spend",
            "description": "Test spending community pool",
            "recipient": "cro1kkqxv3szgh099xezt7y38t5anqzue4s3fhp2tm",
            "amount": [
              {
                "denom": "basecro",
                "amount": "30000"
              }
            ]
          },
          "initial_deposit": [
            {
              "denom": "basecro",
              "amount": "20000"
            }
          ],
          "proposer": "cro1nk4rq3q46ltgjghxz80hy385p9uj0tf58apkcd"
        }
      ],
      "memo": "",
      "timeout_height": "0",
      "extension_options": [],
      "non_critical_extension_options": []
    },
    "auth_info": {
      "signer_infos": [
        {
          "public_key": {
            "@type": "/cosmos.crypto.secp256k1.PubKey",
            "key": "AiLBhn2Jb4CLU5dYpKB3LHDpjIFldrsQWD6LWDHyjpWM"
          },
          "mode_info": {
            "single": {
              "mode": "SIGN_MODE_DIRECT"
            }
          },
          "sequence": "3"
        }
      ],
      "fee": {
        "amount": [
          {
            "denom": "basecro",
            "amount": "5000"
          }
        ],
        "gas_limit": "200000",
        "payer": "",
        "granter": ""
      }
    },
    "signatures": [
      "35gnabiH8b8Sqd4XFM9AY1dvN//xsKuzpGO356u/ZEwCBjtaoUKQIL7yNOao6kqJ4Ezc0RCHzgJT6owkW4iXog=="
    ]
  },
  "tx_response": {
    "height": "19278",
    "txhash": "FF822C74B63571B0FDC886A5061D7B8594A113ACD05A10273C36E46CF63871C6",
    "codespace": "",
    "code": 0,
    "data": "0A150A0F7375626D69745F70726F706F73616C12020801",
    "raw_log": "[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"submit_proposal\"},{\"key\":\"sender\",\"value\":\"cro1nk4rq3q46ltgjghxz80hy385p9uj0tf58apkcd\"},{\"key\":\"module\",\"value\":\"governance\"},{\"key\":\"sender\",\"value\":\"cro1nk4rq3q46ltgjghxz80hy385p9uj0tf58apkcd\"}]},{\"type\":\"proposal_deposit\",\"attributes\":[{\"key\":\"amount\",\"value\":\"20000basecro\"},{\"key\":\"proposal_id\",\"value\":\"1\"}]},{\"type\":\"submit_proposal\",\"attributes\":[{\"key\":\"proposal_id\",\"value\":\"1\"},{\"key\":\"proposal_type\",\"value\":\"CommunityPoolSpend\"},{\"key\":\"voting_period_start\",\"value\":\"1\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"cro10d07y265gmmuvt4z0w9aw880jnsr700jzemu2z\"},{\"key\":\"sender\",\"value\":\"cro1nk4rq3q46ltgjghxz80hy385p9uj0tf58apkcd\"},{\"key\":\"amount\",\"value\":\"20000basecro\"}]}]}]",
    "logs": [
      {
        "msg_index": 0,
        "log": "",
        "events": [
          {
            "type": "message",
            "attributes": [
              {
                "key": "action",
                "value": "submit_proposal"
              },
              {
                "key": "sender",
                "value": "cro1nk4rq3q46ltgjghxz80hy385p9uj0tf58apkcd"
              },
              {
                "key": "module",
                "value": "governance"
              },
              {
                "key": "sender",
                "value": "cro1nk4rq3q46ltgjghxz80hy385p9uj0tf58apkcd"
              }
            ]
          },
          {
            "type": "proposal_deposit",
            "attributes": [
              {
                "key": "amount",
                "value": "20000basecro"
              },
              {
                "key": "proposal_id",
                "value": "1"
              }
            ]
          },
          {
            "type": "submit_proposal",
            "attributes": [
              {
                "key": "proposal_id",
                "value": "1"
              },
              {
                "key": "proposal_type",
                "value": "CommunityPoolSpend"
              },
              {
                "key": "voting_period_start",
                "value": "1"
              }
            ]
          },
          {
            "type": "transfer",
            "attributes": [
              {
                "key": "recipient",
                "value": "cro10d07y265gmmuvt4z0w9aw880jnsr700jzemu2z"
              },
              {
                "key": "sender",
                "value": "cro1nk4rq3q46ltgjghxz80hy385p9uj0tf58apkcd"
              },
              {
                "key": "amount",
                "value": "20000basecro"
              }
            ]
          }
        ]
      }
    ],
    "info": "",
    "gas_wanted": "200000",
    "gas_used": "126092",
    "tx": {
      "@type": "/cosmos.tx.v1beta1.Tx",
      "body": {
        "messages": [
          {
            "@type": "/cosmos.gov.v1beta1.MsgSubmitProposal",
            "content": {
              "@type": "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal",
              "title": "Test Community Pool Spend",
              "description": "Test spending community pool",
              "recipient": "cro1kkqxv3szgh099xezt7y38t5anqzue4s3fhp2tm",
              "amount": [
                {
                  "denom": "basecro",
                  "amount": "30000"
                }
              ]
            },
            "initial_deposit": [
              {
                "denom": "basecro",
                "amount": "20000"
              }
            ],
            "proposer": "cro1nk4rq3q46ltgjghxz80hy385p9uj0tf58apkcd"
          }
        ],
        "memo": "",
        "timeout_height": "0",
        "extension_options": [],
        "non_critical_extension_options": []
      },
      "auth_info": {
        "signer_infos": [
          {
            "public_key": {
              "@type": "/cosmos.crypto.secp256k1.PubKey",
              "key": "AiLBhn2Jb4CLU5dYpKB3LHDpjIFldrsQWD6LWDHyjpWM"
            },
            "mode_info": {
              "single": {
                "mode": "SIGN_MODE_DIRECT"
              }
            },
            "sequence": "3"
          }
        ],
        "fee": {
          "amount": [
            {
              "denom": "basecro",
              "amount": "5000"
            }
          ],
          "gas_limit": "200000",
          "payer": "",
          "granter": ""
        }
      },
      "signatures": [
        "35gnabiH8b8Sqd4XFM9AY1dvN//xsKuzpGO356u/ZEwCBjtaoUKQIL7yNOao6kqJ4Ezc0RCHzgJT6owkW4iXog=="
      ]
    },
    "timestamp": "2021-05-02T15:14:05Z"
  }
}

Community Pool Spend Proposal Funds Movement

Detail
Accessor
Type

Proposal Passed

Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].value) === "proposal_passed" where .result.end_block_events[event_index].type === "active_proposal" && Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].key) === "proposal_result".

String

Grant from "distribution" Module Account

Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].value) === "{distribution module account}" where .result.end_block_events[event_index].type === "transfer" && Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].key) === "sender".

String

Recipient Account

Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].value) where .result.end_block_events[event_index].type === "transfer" && Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].key === "recipient").

String

Grants Amount

Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].value) where .result.end_block_events[event_index].type === "transfer" && Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].key === "amount").

Example of Block Results API when Community Pool Spend Proposal Funds is Released:

{
  "jsonrpc": "2.0",
  "id": -1,
  "result": {
    "height": "19337",
    "txs_results": null,
    "begin_block_events": [
	  ...
    ],
    "end_block_events": [
      {
        "type": "transfer",
        "attributes": [
          {
            "key": "recipient",
            "value": "cro1nk4rq3q46ltgjghxz80hy385p9uj0tf58apkcd",
            "index": true
          },
          {
            "key": "sender",
            "value": "cro10d07y265gmmuvt4z0w9aw880jnsr700jzemu2z",
            "index": true
          },
          {
            "key": "amount",
            "value": "20000basecro",
            "index": true
          }
        ]
      },
      {
        "type": "message",
        "attributes": [
          {
            "key": "sender",
            "value": "cro10d07y265gmmuvt4z0w9aw880jnsr700jzemu2z",
            "index": true
          }
        ]
      },
      {
        "type": "transfer",
        "attributes": [
          {
            "key": "recipient",
            "value": "cro1kkqxv3szgh099xezt7y38t5anqzue4s3fhp2tm",
            "index": true
          },
          {
            "key": "sender",
            "value": "cro1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8lyv94w",
            "index": true
          },
          {
            "key": "amount",
            "value": "30000basecro",
            "index": true
          }
        ]
      },
      {
        "type": "message",
        "attributes": [
          {
            "key": "sender",
            "value": "cro1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8lyv94w",
            "index": true
          }
        ]
      },
      {
        "type": "active_proposal",
        "attributes": [
          {
            "key": "proposal_id",
            "value": "1",
            "index": true
          },
          {
            "key": "proposal_result",
            "value": "proposal_passed",
            "index": true
          }
        ]
      }
    ],
    "validator_updates": null,
    "consensus_param_updates": {
	  ...
    }
  }
}

2. MsgDeposit

  • Descriptions: Submit a deposit to an existing proposal

    Deposit will transfer from the proposer account to the "gov" module account.

Protobuf

type MsgDeposit struct {
	ProposalId uint64                                   `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"`
	Depositor  string                                   `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"`
	Amount     github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
}

Example

Details

Detail
Accessor
Type

Transaction Type

tx.body.messages[message_index]["@type"] === "/cosmos.gov.v1beta1.MsgDeposit"

String

Deposit From Address

tx.body.messages[message_index].depositor

String

Deposit Amount

tx.body.messages[message_index].amount

2a. Burn Proposal's Deposit if Proposal does not Get Enough Deposit

If a proposal does not meet the deposit requirement after the deposit period, the deposit will NOT be returned to the depositors. Those deposits will be burnt from the "gov" module account as well.

To monitor a proposal becomes inactive, it can be detected by monitoring the end_block_events in Tendermint Block Results API. However, for the amount of deposit burnt, you have to keep track of the deposits made to the proposal before. Note that this operation does not involve any user account as the deposits are burnt.

Details

Detail
Accessor
Type

Proposal Id

Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].value) === "{gov module account}" where .result.end_block_events[event_index].type === "inactive_proposal" && .result.Base64Decode(end_block_events[event_index].attributes[attribute_index].key) === "proposal_id".

String

Assert Proposal is Dropped

Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].value === "proposal_dropped") where .result.end_block_events[event_index].type === "inactive_proposal" && Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].key === "proposal_result").

String

2b. Return Proposal's Deposit

The return deposit can be detected by monitoring the end_block_events in Tendermint Block Results API.

Example

Details

Detail
Accessor
Type

Return From "gov" Module Account

Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].value) === "{gov module account}" where .result.end_block_events[event_index].type === "transfer" && Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].key) === "sender".

String

Return To Address

Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].value) where .result.end_block_events[event_index].type === "transfer" && Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].key) === "recipient".

String

Returned Deposit Amount

Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].value) where .result.end_block_events[event_index].type === "transfer" && Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].key === "amount").

Note that there may be multiple depositors of a proposal, so the event may appear multiple times.

[
  {
    "type": "transfer",
    "attributes": [
      {
        "key": "recipient",
        "value": "cro15d0esada05wx4lpncp5vmwmzgrcnu3cu5xfy9w",
        "index": true
      },
      {
        "key": "sender",
        "value": "cro10d07y265gmmuvt4z0w9aw880jnsr700jzemu2z",
        "index": true
      },
      {
        "key": "amount",
        "value": "1000000000basecro",
        "index": true
      }
    ]
  },
  {
    "type": "transfer",
    "attributes": [
      {
        "key": "recipient",
        "value": "cro1meq5gd2fwjcav8n0nynwelusm9hrngwglvp426",
        "index": true
      },
      {
        "key": "sender",
        "value": "cro10d07y265gmmuvt4z0w9aw880jnsr700jzemu2z",
        "index": true
      },
      {
        "key": "amount",
        "value": "2000000000000basecro",
        "index": true
      }
    ]
  }
]

2c. Burn Proposal's Deposit

If a proposal does not get enough votes that exceed the "quorum" or has the "No with Veto" votes exceed the "veto_threshold", the deposit will NOT be returned to the depositors. Those deposits will be burnt from the "gov" module account as well.

However, for the amount of deposit burnt, you have to keep track of the deposits made to the proposal before. Note that this operation does not involve any user account as the deposits are burnt.

Details and Example

Detail
Accessor
Type

Proposal Id

Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].value) === "{gov module account}" where .result.end_block_events[event_index].type === "active_proposal" && .result.Base64Decode(end_block_events[event_index].attributes[attribute_index].key) === "proposal_id".

String

Assert Proposal is Rejected

Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].value === "proposal_rejected") where .result.end_block_events[event_index].type === "active_proposal" && Base64Decode(.result.end_block_events[event_index].attributes[attribute_index].key === "proposal_result").

String

Tendermint Block Results API JSON Example (Base64 Decoded):

{
  "jsonrpc": "2.0",
  "id": -1,
  "result": {
    "height": "285",
    "txs_results": null,
    "begin_block_events": [
      ...
    ],
    "end_block_events": [
      {
        "type": "active_proposal",
        "attributes": [
          {
            "key": "proposal_id",
            "value": "3",
            "index": true
          },
          {
            "key": "proposal_result",
            "value": "proposal_rejected",
            "index": true
          }
        ]
      }
    ],
    "validator_updates": null,
    "consensus_param_updates": {
      ...
    }
  }
}

3. MsgVote

  • Descriptions: : Submit a vote to an existing proposal

  • Funds movement: No (Pay for fee only)

4. Proposal Result

Scenario
Result
Burn Deposit

All voter has no staked coins

Rejects

No

Not enough tally_params.quorum of votes

Rejects

Yes

No one votes (Everyone abstain)

Rejects

No

More than tally_params.veto_threshold voter veto

Rejects

Yes

More than tally_params.threshold non-abstaining votes No

Rejects

No

More than tally_params.threshold non-abstaining votes Yes

Passes

No

More than tally_params.threshold non-abstaining votes Yes but the proposal cannot be executed (e.g. Insufficient funds in community pool to spend)

Failed

No

Appendix: Module Accounts on Mainnet

Module
Address

mint

fee_collector

distribution

bonded_tokens_pool

not_bonded_tokens_pool

gov

URL format: [height]

Example: Checking the block at height 10000 of the mainnet:

URL format: [height]

Example: Checking the block result of height 10000of the mainnet:

URL format: [Transaction_Hash]

Example:

URL format:

Most of the block events can be accessed using the . One caveat of using this API is that all the events key-value attributes are base64 encoded. Therefore it is non-human readable.

A simple Node.js tool has been written to help parse and decode all key-value attributes in the block results API response. It can be downloaded at .

In every block, CRO is minted and offered to the active validators and their delegators as block rewards. The actual minted token is subject to inflation and is adjusted every block. Further details on the minting parameters and configuration can be found .

Minted tokens are distributed as blocks and proposer rewards in the same block. However, since Cosmos SDK does the , the minted tokens are first sent to the "Distribution" module account and are later transferred to an account when a delegator withdraws the rewards or commissions by sending a or .

So , and events are for record-keeping only and do not represent any actual token transfer between accounts.

Block rewards are not credited to the delegator account directly. This event serves as a record-keeping purpose only. Each delegator account must explicitly send a message transaction to collect the rewards.

Block proposers can get extra transaction fees bonus for the block they have successfully proposed. More details can be found for reference.

Similar to block rewards, proposer rewards are not credited to the account directly. This event serves as a record-keeping purpose only. Each validator creator account must explicitly send a message transaction to collect the rewards.

Validator can charge a commission to the block rewards received by delegators. Commissions is already included in and

Similar to block rewards, commission rewards are not credited to the account directly. This event serves as a record-keeping purpose only. Each validator creator account must explicitly send a message transaction to collect the rewards.

: result.block.header.height

: result.height

: tx_response.height

: tx_response[index].height

: Uppercase(SHA256(Base64Decode(result.block.data.txs[index])))

: Not available, should use . Match transaction [index] in result.txs_results with result.block.data.txs[index]

: tx_response.txhash

: tx_response[index].txhash

: tx.auth_info.fee.amount

: tx[index].auth_info.fee.amount

Transaction fee is an , meaning that a transaction can pay fee in more than one token types.

Note that the amount is always in string for precision accuracy. Please make sure your language is capable of handling big integer numbers. It is highly recommended to use library similar to in your language to handle the amount.

At the time of writing, there will only be a single entry in this array because basecro (or basetcro in Croeseid Testnet) is the only supported asset on Cronos POS Chain. However, after IBC transfer and other coins issuance methods are enabled, there will be more asset types, the coin source tracing and their denomination can be found

Each object in the array has the same format as .

Cosmos Transaction Query API:

Cosmos Transaction Query API:

Cosmos Transaction Query API:

Cosmos Transaction Query API:

Cosmos Transaction Query API:

The "Distribution" module account is different on different chain. In Cronos POS Chain Mainnet, it is .

This "Distribution" module account is different on different chain. In Cronos POS Chain Mainnet, it is .

Cosmos Transaction Query API:

Cosmos Transaction Query API:

Cosmos Transaction Query API:

Cosmos Transaction Query API:

Note that the funds are moved between module accounts upon a MsgUndelegate message execution. The funds movement to the user account happens only when the unbond completes. For details, you can refer to the .

Cosmos Transaction Query API:

Tendermint Block Results API:

Cosmos Transaction Query API:

# The liveness metrics and the penalty are subject to the network parameters to be explained in the

# The slashing rate is subject to the network parameters to be explained in the

Cosmos Slashing Params API:

Tendermint Block Results API: =[height]

You can use the to decode the event details for readability during integration.

Liveness Example:

Double Sign Example:

Cosmos Transaction Query API:

One sub-type of proposal is to spend community pool. The community has to pre-funded using .

Cosmos Transaction Query API:

The latest deposit requirement ("min_deposit") and deposit period ("max_deposit_period") can be checked on . Note that they are network parameters and may change over time after governance proposals.

Tendermint Block Results API:

There are a few cases where a proposal deposit will be returned to the depositors. For details, please refer to .

Tendermint Block Results API:

There are a few cases where proposal deposits will be burnt. For details, please refer to for more details.

To monitor a proposal that got rejected and deposits got burned, it can be detected by monitoring the end_block_events Tendermint Block Results API. There will be a "proposal_result" event marking the proposal as rejected, and different from , there will be NO transfer event in the end_block_results, which means the deposit is NOT returned and is burnt.

Latest tally params can be retrieved from: . The params may change from time to time after the governance proposal.

🔲
https://rpc.mainnet.crypto.org/block?height=
https://
rpc.mainnet.crypto.org
/block?height=10000
https://rpc.mainnet.crypto.org/block_results?height=
https://
rpc.mainnet.crypto.org
/block_results?height=10000
https://rest.mainnet.crypto.org/cosmos/tx/v1beta1/txs/
https://rest.mainnet.crypto.org/cosmos/tx/v1beta1/txs/0C5E617B0577B047D78EBF5313B8B70DF69E9535E17B964303BD04947B11B660
https://rest.mainnet.crypto.org/cosmos/tx/v1beta1/txs
https://github.com/calvinaco/cosmos-api-tools
here
here
bignumber.js
here
https://rest.mainnet.crypto.org/cosmos/tx/v1beta1/txs/0C5E617B0577B047D78EBF5313B8B70DF69E9535E17B964303BD04947B11B660
https://rest.mainnet.crypto.org/cosmos/tx/v1beta1/txs/6CD89C9F32A4F4E918B2BCD722A9429693E3372E3F882BA4A460F2588A2EE0B3
https://rest.mainnet.crypto.org/cosmos/tx/v1beta1/txs/D4FCC8E1403677157D367A88A0832B9E411BDC4E029954FC133DB60296CF3DE3
https://rest.mainnet.crypto.org/cosmos/tx/v1beta1/txs/3B36AA1AC81ACD58E7A06C21353DB0FC40A70EDBF6BD2CD23D7BEDC7A0F56318
https://
rest.mainnet.crypto.org
/cosmos/tx/v1beta1/txs/3739F76EF67A61D6F0163A5B177EA64ED80B67D9AEF8435C525913E69026D320
cro1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8lyv94w
https://
rest.mainnet.crypto.org
/cosmos/tx/v1beta1/txs/7C1747E0189DCA88BBA55A1720809C8DF6075799C11ECBE4C4E1F89C91D4F55F
cro1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8lyv94w
https://rest.mainnet.crypto.org/cosmos/tx/v1beta1/txs/7B3C19A3674C9EF856C43FFF50B021085AC4DA693AA47F82882FFAC78F21DE05
https://rest.mainnet.crypto.org/cosmos/tx/v1beta1/txs/F4A1D7757AD20979D540C0CD29DD335D17E121F15AA447990B87E0EE94531BD7
https://
rest.mainnet.crypto.org
/cosmos/tx/v1beta1/txs/CCB45B0C6EC18A327ADFC8C36478A163D8C2A8BD9EB13687F73ED3D4559318A3
https://rest.mainnet.crypto.org/cosmos/tx/v1beta1/txs/5D43A55463C8FB30A89306C26C5E3318826AD075D36E9B5E72F7019C00F14549
https://
rpc.mainnet.crypto.org
/cosmos/tx/v1beta1/txs/3B36AA1AC81ACD58E7A06C21353DB0FC40A70EDBF6BD2CD23D7BEDC7A0F56318
https://
rpc.mainnet.crypto.org
/block_results?height=374823
https://rest.mainnet.crypto.org/cosmos/tx/v1beta1/txs/58BF8EBD17FF9500F395E4A9B2AE93EF21306E5706B3EC31CE116654D78B8684
https://rest.mainnet.crypto.org/cosmos/slashing/v1beta1/params
https://rpc.mainnet.crypto.org/block?height
https://rpc.mainnet.crypto.org/block_results?height=210356
https://rpc.mainnet.crypto.org/block_results?height=210356
https://rpc.mainnet.crypto.org/cosmos/tx/v1beta1/txs/9CCC988616344C804E8831B6FC6BECD6FD0F815E4E3FF13BDE6B7F8360BF0050
https://rpc.mainnet.crypto.org/cosmos/tx/v1beta1/txs/9CCC988616344C804E8831B6FC6BECD6FD0F815E4E3FF13BDE6B7F8360BF0050
https://rpc.mainnet.crypto.org/cosmos/gov/v1beta1/params/deposit
https://rpc.mainnet.crypto.org/block_results?height=195346
https://
rpc.mainnet.crypto.org
:443/block_results?height=496620
https://rest.mainnet.crypto.org/cosmos/gov/v1beta1/params/tallying
Cronos POS Blocks and Transactions
Table of Content
Common APIs
1. Tendermint Block API
2. Tendermint Block Results API
3. Cosmos Transaction Query API
4. Cosmos Transaction Search API
Common Block Details
1. Mint
2. Block Rewards
3. Proposer Rewards
4. Commissions
Common Transaction Details
1. Block Height
2. Transaction Hash
3. Transaction Fee
4. Assets and Amount
1. Single object
2. Array
3. String
Bank
1. MsgSend
2. MsgMultiSend
Distribution
1. MsgSetWithdrawAddress
2. MsgWithdrawDelegatorReward
3. MsgWithdrawValidatorCommission
4. MsgFundCommunityPool
Staking
1. MsgCreateValidator
2. MsgEditValidator
3. MsgDelegate
4. MsgBeginRedelegate
5. MsgUndelegate
5a. Upon MsgUndelegate completed
Slashing
1. MsgUnjail
2. Being Jailed and Slashed
Liveness
Double Sign
Limitations
Governance
1. MsgSubmitProposal
1a. Community Pool Spend Proposal
2. MsgDeposit
2a. Burn Proposal's Deposit if Proposal does not Get Enough Deposit
2b. Return Proposal's Deposit
2c. Burn Proposal's Deposit
3. MsgVote
4. Proposal Result
Appendix: Module Accounts on Mainnet
Top
Tendermint Block Results API
lazy rewards calculation and collection
MsgWithdrawDelegatorReward
MsgWithdrawValidatorCommission
Block Rewards
Proposer Rewards
Commissions
MsgWithdrawDelegatorReward
MsgWithdrawDelegatorReward
Block Rewards
Proposer Rewards
MsgWithdrawValidatorCommission
Top
Tendermint Block API
Tendermint Block Results API
Cosmos Transaction Query API
Cosmos Transaction Search API
Tendermint Block API
Tendermint Block Results API
Tendermint Block API
Cosmos Transaction Query API
Cosmos Transaction Search API
Cosmos Transaction Query API
Cosmos Transaction Search API
Asset Array
Single Object
Top
Top
Top
Top
Top
Top
next section
Top
Top
details section
details section
Cosmos API tools
Top
MsgFundCommunityPool
Top
Proposal Result
Top
Proposal Result
Return Proposal's Deposit
Top
Top
Top
txs?events=tx.height%3D10000
txs?events=message.module%3D%27bank%27&events=message.action%3D%27send%27
/txs?events=message.sender=%27cro18undzhe3fmmav2x3csx8m00m5yupkcc7qzz4ec%27
cro1m3h30wlvsf8llruxtpukdvsy0km2kum8s20pm3
cro17xpfvakm2amg962yls6f84z3kell8c5lgztehv
cro1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8lyv94w
cro1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3dqpk9x
cro1tygms3xhhs3yv487phx3dw4a95jn7t7leqa8nj
cro10d07y265gmmuvt4z0w9aw880jnsr700jzemu2z
Asset String
Asset String
Asset String
Asset String
Asset Array
Asset Array
Asset Array
Asset String
Asset String
Asset Array
Asset Object
Asset Object
Asset Object
Asset Object
Asset String
Asset Array
Asset Array
Asset String
Asset Array
Asset String