DefAI Documentation

Learn how DefAI validates blockchain transaction data

Overview

DefAI employs a comprehensive validation process to ensure the accuracy and uniqueness of submitted transaction data. Here's a detailed breakdown of how our system validates your submissions.

1. Transaction Receipt Format

{
  "root": "0x",
  "status": "0x1",
  "cumulativeGasUsed": "0x10a4b71",
  "logsBloom": "0x....",
  "logs": [
    {
      "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x000000000000000000000000a15ede0cf46c12e4a79632df33ba1b2f428e5d15",
        "0x000000000000000000000000b685760ebd368a891f27ae547391f4e2a289895b"
      ],
      "data": "0x00000000000000000000000000000000000000000000000000000005079ebcc0",
      "blockNumber": "0x149cb95",
      "transactionHash": "0x...",
      "transactionIndex": "0x7d",
      "blockHash": "0x77eed4aed85d5c76153311c820fd715f86e41b1bed6efbaa652c5d2359cb4019",
      "logIndex": "0x22e",
      "removed": false
    }
  ],
  "transactionHash": "0x...",
  "contractAddress": "0x0000000000000000000000000000000000000000",
  "gasUsed": "0xb429",
  "effectiveGasPrice": "0x74d185be",
  "blockHash": "0x77eed4aed85d5c76153311c820fd715f86e41b1bed6efbaa652c5d2359cb4019",
  "blockNumber": "0x149cb95",
  "transactionIndex": "0x7d",
  "tx_type": "Arbitrage Trade",
  "description": "Arbitrage Trade on Ethereum, arbitrage between Uniswap and SushiSwap"
}

The JSON file should contain the complete transaction receipt with all relevant transaction details.

2. Validation Steps

Transaction Existence

Verifies that the transaction exists on the specified blockchain network by checking the transaction hash.

Receipt Verification

Compares the submitted receipt data with the actual transaction data from the blockchain to ensure accuracy.

Duplicate Check

Ensures the same transaction hasn't been submitted before by checking against our database.

3. Status Codes

Status 0: Pending

Transaction is submitted and awaiting validation

Status 1: Verified

Transaction has passed all validation checks

Status 2: Rewarded

Verification reward has been distributed

Status -1: Failed

Transaction failed validation checks

4. Common Issues

  • Invalid transaction hash format
  • Transaction not found on the specified network
  • Receipt data doesn't match blockchain data
  • Duplicate submission
  • Incorrect network selection

Ready to get started? Sign in or create an account