Transaction Model
An introduction and overview of the VeChainThor blockchain transaction model.
VeChainThor defines a transaction in Golang as:
// transaction.go
type Transaction struct {
body body
}
type body struct {
ChainTag byte
BlockRef uint64
Expiration uint32
Clauses []*Clause
GasPriceCoef uint8
Gas uint64
MaxFeePerGas *big.Int
MaxPriorityFeePerGas *big.Int
DependsOn *thor.Bytes32 `rlp:"nil"`
Nonce uint64
Reserved reserved
Signature []byte
}
Fields within the transaction body
, , are defined as:
ChainTag
– last byte of the genesis block ID which is used to identify a blockchain to prevent the cross-chain replay attackBlockRef
- reference to a specific blockExpiration
– how long, in terms of the number of blocks, the transaction will be allowed to be mined in VeChainThorClauses
– an array of Clause objects each of which contains fieldsTo
,Value
andData
to enable a single transaction to carry multiple tasks issued by the transaction senderGasPriceCoef
– coefficient used to calculate the gas price for legacy transactionsGas
– maximum amount of gas allowed to pay for the transactionMaxFeePerGas
- the absolute maximum to pay per unit of gasMaxPriorityFeePerGas
- the absolute maximum tip to pay per unit of gas directly to the proposerDependsOn
– ID of the transaction on which the current transaction dependsNonce
– a random number set by the wallet / userReserved
- reserved Object contains two fields:Features
andUnused
Feature
as 32-bit unsigned integer and default set as0
.For Designated Gas Payer (VIP-191) must be set as1
Unused
an array of reserved field for backward compatibility, it MUST be set as an empty array for now otherwise the transaction will be considered invalid
Signature
- transaction signature, , where is the transaction sender's private key
Last updated
Was this helpful?