Developers migrating from Ethereum or building new dApps on VeChainThor must consider these differences:
- Transaction Structure:
Ethereum transactions are incompatible with VeChainThor. Developers must construct transactions using the VeChainThor format. Libraries provided in vechain-sdk-j are essential for this. Here follows the transaction body structure:
| Field | Type | JSON Key | Description |
|---|---|---|---|
| ChainTag | byte | chainTag | Identifies the blockchain network the transaction is targeting. |
| BlockRef | string | blockRef | Reference to a specific block to maintain ordering and prevent replay attacks. |
| Expiration | uint32 | expiration | Number of blocks until the transaction expires. |
| Clauses | []*JSONClause | clauses | Array of operation clauses (each clause represents a contract call or transfer). |
| GasPriceCoef | uint8 | gasPriceCoef | Multiplier adjusting the base gas price, affecting transaction priority. |
| Gas | uint64 | gas | Maximum amount of gas allocated for execution. |
| Origin | thor.Address | origin | Address initiating the transaction. |
| Delegator | *thor.Address | delegator | (Optional) If present, indicates a delegator executing on behalf of origin. |
| Nonce | math.HexOrDecimal64 | nonce | A unique number preventing transaction replay attacks. |
| DependsOn | *thor.Bytes32 | dependsOn | (Optional) Specifies a dependency on another transaction’s hash. |
- RPC Compatibility and the SDK RPC Proxy:
The SDK RPC Proxy offers partial Ethereum JSON-RPC compatibility. Not all methods are supported, and some have different behaviors or limitations. Consult the official VeChainThor documentation for the updated list of supported methods (see Section RPC Methods).
- Gas Calculation and VTHO:
Gas costs are paid in VTHO, not VET. Developers need to ensure their accounts have sufficient VTHO. Use VeChainThor-specific APIs to estimate VTHO costs. A feeDelegation service can be used to overcome the need, and the specific provider configuration is supported in the VeChain SDK.
- Smart Contract Compilation:
VeChainThor supports Solidity up to the Paris EVM version.