transaction.proto
path vega/commands/v1/transaction.proto
package vega.commands.v1
Messages
InputData
Name | Type | Description |
---|---|---|
nonce | uint64 | Number to provide uniqueness to prevent accidental replays and, in combination with `block_height`, deliberate attacks. A nonce provides uniqueness for otherwise identical transactions, ensuring that the transaction hash uniquely identifies a specific transaction. Granted all other fields are equal, the nonce can either be a counter or generated at random to submit multiple transactions within the same block (see below), without being identified as replays. Please note that Protocol Buffers do not have a canonical, unique encoding and therefore different libraries or binaries may encode the same message slightly differently, causing a different hash. |
block_height | uint64 | Block height at which the transaction was made. This should be the current block height. The transaction will be valid from the block and up to the `tolerance` block height. Example: If the network has a tolerance of 150 blocks and `block_height` is set to `200`, then the transaction will be valid until block `350`. Note that a `block_height` that is ahead of the real block height will be rejected. The tolerance can be queried from the chain's network parameters. `block_height` prevents replay attacks in conjunction with `nonce` (see above). |
order_submission | OrderSubmission | Command for submitting an order. |
order_cancellation | OrderCancellation | Command to cancel an order. |
order_amendment | OrderAmendment | Command to amend an order. |
withdraw_submission | WithdrawSubmission | Command to submit a withdrawal. |
proposal_submission | ProposalSubmission | Command to submit a governance proposal. |
vote_submission | VoteSubmission | Command to submit a vote on a governance proposal. |
liquidity_provision_submission | LiquidityProvisionSubmission | Command to submit a liquidity commitment. |
delegate_submission | DelegateSubmission | Command to delegate tokens to a validator. |
undelegate_submission | UndelegateSubmission | Command to remove tokens delegated to a validator. |
liquidity_provision_cancellation | LiquidityProvisionCancellation | Command to request cancelling a liquidity commitment. |
liquidity_provision_amendment | LiquidityProvisionAmendment | Command to request amending a liquidity commitment. |
transfer | Transfer | Command to submit a transfer. |
cancel_transfer | CancelTransfer | Command to request cancelling a recurring transfer. |
announce_node | AnnounceNode | Command used by a node operator to announce its node as a pending validator. |
batch_market_instructions | BatchMarketInstructions | Command to submit a batch of order instructions to a market. |
node_vote | NodeVote | Command used by a validator when a node votes for validating that a given resource exists or is valid, for example, an ERC20 deposit is valid and exists on ethereum. |
node_signature | NodeSignature | Command used by a validator to submit a signature, to be used by a foreign chain to recognise a decision taken by the Vega network. |
chain_event | ChainEvent | Command used by a validator to submit an event forwarded to the Vega network to provide information on events happening on other networks, to be used by a foreign chain to recognise a decision taken by the Vega network. |
key_rotate_submission | KeyRotateSubmission | Command used by a validator to allow given validator to rotate their Vega keys. |
state_variable_proposal | StateVariableProposal | Command used by a validator to submit a floating point value. |
validator_heartbeat | ValidatorHeartbeat | Command used by a validator to signal they are still online and validating blocks or ready to validate blocks when they are still a pending validator. |
ethereum_key_rotate_submission | EthereumKeyRotateSubmission | Command used by a validator to allow given validator to rotate their Ethereum keys. |
protocol_upgrade_proposal | ProtocolUpgradeProposal | Command used by a validator to propose a protocol upgrade. |
issue_signatures | IssueSignatures | Command used by a validator to submit signatures to a smart contract. |
oracle_data_submission | OracleDataSubmission | Command to submit new oracle data from third party providers. |
ProofOfWork
Components needed for the network to verify proof-of-work
Name | Type | Description |
---|---|---|
tid | string | Unique transaction identifier used to seed the proof-of-work hash. |
nonce | uint64 | Number which, combined with the transaction identifier, will produce a hash with the required number of leading zeros to be accepted by the network. |
Transaction
Represents a transaction to be sent to Vega.
Name | Type | Description |
---|---|---|
input_data | bytes | One of the set of Vega commands. These bytes are should be built as follows: chain_id_as_bytes + \0 character as delimiter + proto_marshalled_command. |
signature | Signature | Signature of the input data. |
address | string | Hex-encoded address of the sender. Not supported yet. |
pub_key | string | Hex-encoded public key of the sender. |
version | TxVersion | Version of the transaction, to be used in the future in case changes are implemented to the transaction format. |
pow | ProofOfWork | Proof of work contains the random transaction id used by the client and the nonce. |
Enums
TxVersion
Current supported version of the transaction inside the network.
Name | Number | Description |
---|---|---|
TX_VERSION_UNSPECIFIED | 0 | Represents an unspecified or missing value from the input |
TX_VERSION_V2 | 2 | This version requires the proof-of-work added to the transaction. |
TX_VERSION_V3 | 3 | This version requires the chain ID to be appended in front of the input data byte, with a `\0` delimiter. |