# Messages
This is a reference document for Peggy message types. For code reference and exact arguments see the proto definitions (opens new window).
# User messages
These are messages sent on the Injective Chain peggy module. See workflow for a more detailed summary of the entire deposit and withdraw process.
# SendToEth
SendToEth allows the user to specify an Ethereum destination, a token to send to Ethereum and a fee denominated in that same token to pay the relayer. Note that this transaction will contain two fees. One fee amount to submit to the Injective Chain, that can be paid in any token and one fee amount for the Ethereum relayer that must be paid in the same token that is being bridged.
# CancelSendToEth
CancelSendToEth allows a user to retrieve a transaction that is in the batch pool but has not yet been packaged into a transaction batch by a relayer running RequestBatch.
# SubmitBadSignatureEvidence
SubmitBadSignatureEvidence allows anyone to submit evidence that a validator has signed a valset or batch that never existed.
# Relayer Messages
These are messages run by relayers. Relayers are unpermissioned and simply work to move things from the Injective Chain to Ethereum.
# RequestBatch
Relayers use QueryPendingSendToEth
in query.proto (opens new window) to query the potential fees for a batch of each
token type. When they find a batch that they wish to relay they send in a RequestBatch message and the Peggy module creates a batch.
This then triggers the Ethereum Signers to send in ConfirmBatch messages, which the signatures required to submit the batch to the Ethereum chain.
At this point any relayer can package these signatures up into a transaction and send them to Ethereum.
As noted above this message is unpermissioned and it is safe to allow anyone to call this message at any time.
# Oracle Messages
All validators run two processes in addition to their Injective node. An Ethereum oracle and Ethereum signer, these are bundled into a single Orchestrator binary for ease of use.
The oracle observes the Ethereum chain for events from the Peggy.sol (opens new window) contract before submitting them as messages to the Injective Chain.
# DepositClaim
Deposit claims represent a SendToCosmosEvent
emitted by the Peggy contract. After 2/3 of the validators confirm a deposit claim, the representative tokens will be issued to the specified CosmosReceiver
Injective Chain account.
# WithdrawClaim
Withdraw claims represent a TransactionBatchExecutedEvent
from the Peggy contract. When this passes the oracle vote the batch in state is cleaned up and tokens are burned/locked.
# ValsetUpdateClaim
claim representing a ValsetUpdatedEvent
from the Peggy contract. When this passes the oracle vote reward amounts are tallied and minted.
# ERC20DeployedClaim
claim representing a ERC20DeployedEvent
from the Peggy contract. When this passes the oracle vote it is checked for accuracy and adopted or rejected as the ERC-20 representation of a Cosmos SDK based asset.
# Ethereum Signer Messages
All validators run two processes in addition to their Injective Chain node. An Ethereum oracle and Ethereum signer, these are bundled into a single Orchestrator binary for ease of use.
The Ethereum signer watches several query endpoints (opens new window) and it's only job is to submit a signature for anything that appears on those endpoints. For this reason the validator must provide a secure RPC to an Injective Chain node following chain consensus. Or they risk being tricked into signing the wrong thing.
# ConfirmBatch
Submits an Ethereum signature over a batch appearing in the LastPendingBatchRequestByAddr
query.
# ValsetConfirm
Submits an Ethereum signature over a batch appearing in the LastPendingValsetRequestByAddr
query.
# Validator Messages
These are messages sent directly using the validator's message key.
# SetOrchestratorAddresses
This message sets the Orchestrator's delegate keys.