Messages

This is a reference document for Peggy message types. For code reference and exact arguments see the proto definitions.

User messages

These are messages sent on the Injective Chain peggy module by the end user. See workflow for a more detailed summary of the entire deposit and withdraw process.

SendToEth

Sent to Injective whenever a user wishes to make a withdrawal back to Ethereum. Submitted amount is removed from the user's balance immediately. The withdrawal is added to the outgoing tx pool as a types.OutgoingTransferTx where it will remain until it is included in a batch.

type MsgSendToEth struct {
	Sender    string    // sender's Injective address
	EthDest   string    // receiver's Ethereum address
	Amount    types.Coin    // amount of tokens to bridge
	BridgeFee types.Coin    // additional fee for bridge relayers. Must be of same token type as Amount
}

CancelSendToEth

This message allows the user to cancel a specific withdrawal that is not yet batched. User balance is refunded (Amount + BridgeFee).

type MsgCancelSendToEth struct {
	TransactionId uint64    // unique tx nonce of the withdrawal
	Sender        string    // original sender of the withdrawal
}

SubmitBadSignatureEvidence

This call allows anyone to submit evidence that a validator has signed a valset or batch that never existed. Subject contains the batch or valset.

Batch Creator Messages

These messages are sent by the Batch Creator subprocess of peggo

RequestBatch

This message is sent whenever some Batch Creator finds pooled withdrawals that when batched would satisfy their minimum batch fee (PEGGO_MIN_BATCH_FEE_USD). After receiving this message the Peggy module collects all withdrawals of the requested token denom, creates a unique token batch (types.OutgoingTxBatch) and places it in the Outgoing Batch pool. Withdrawals that are batched cannot be cancelled with MsgCancelSendToEth.

Oracle Messages

These messages are sent by the Oracle subprocess of peggo

DepositClaim

Sent to Injective when a SendToInjectiveEvent is emitted from the Peggy contract. This occurs whenever a user is making an individual deposit from Ethereum to Injective.

WithdrawClaim

Sent to Injective when a TransactionBatchExecutedEvent is emitted from the Peggy contract. This occurs when a Relayer has successfully called submitBatch on the contract to complete a batch of withdrawals.

ValsetUpdatedClaim

Sent to Injective when a ValsetUpdatedEvent is emitted from the Peggy contract. This occurs when a Relayer has successfully called updateValset on the contract to update the Validator Set on Ethereum.

ERC20DeployedClaim

Sent to Injective when a ERC20DeployedEvent is emitted from the Peggy contract. This occurs whenever the deployERC20 method is called on the contract to issue a new token asset eligible for bridging.

Signer Messages

These messages are sent by the Signer subprocess of peggo

ConfirmBatch

When Signer finds a batch that the Orchestrator (Validator) has not signed off, it constructs a signature with its Delegated Ethereum Key and sends the confirmation to Injective. It's crucial that a Validator eventually provides their confirmation for a created batch as they will be slashed otherwise.

ValsetConfirm

When Signer finds a valset update that the Orchestrator (Validator) has not signed off, it constructs a signature with its Delegated Ethereum Key and sends the confirmation to Injective. It's crucial that a Validator eventually provides their confirmation for a created valset update as they will be slashed otherwise.

Relayer Messages

The Relayer does not send any message to Injective, rather it constructs Ethereum transactions with Injective data to update the Peggy contract via submitBatch and updateValset methods.

Validator Messages

These are messages sent directly using the validator's message key.

SetOrchestratorAddresses

Sent to Injective by an Operator managing a Validator node. Before being able to start their Orchestrator (peggo) process, they must register a chosen Ethereum address to represent their Validator on Ethereum. Optionally, an additional Injective address can be provided (Orchestrator field) to represent that Validator in the bridging process (peggo). Defaults to Validator's own address if omitted.

This message sets the Orchestrator's delegate keys.

Last updated