Phase 1 of WIA-FIN-003 defines the fundamental data structures that form the bedrock of cryptocurrency interoperability. In this chapter, we dive deep into the technical specifications for transaction schemas, the UTXO (Unspent Transaction Output) model, address formats, and validation rules.
Understanding these data formats is crucial because they enable different blockchain systems to represent information in a unified way, making cross-chain analytics, wallets, and applications possible without requiring separate implementations for each blockchain.
4.1 Universal Transaction Schema
The WIA transaction schema is designed to represent any cryptocurrency transactionโwhether from Bitcoin, Ethereum, Solana, or future blockchainsโin a consistent JSON format. This blockchain-agnostic approach enables developers to build tools that work across the entire cryptocurrency ecosystem.
Core Transaction Fields
| Field | Type | Required | Description |
|---|---|---|---|
wia_version |
string | Yes | WIA standard version (e.g., "1.0") |
transaction_id |
string | Yes | Unique transaction identifier (hash) |
blockchain |
string | Yes | Source blockchain ("bitcoin", "ethereum", "solana") |
network |
string | Yes | Network type ("mainnet", "testnet", "devnet") |
type |
string | Yes | Transaction type ("transfer", "contract_call", "deployment") |
timestamp |
string | Yes | ISO 8601 timestamp (UTC) |
block_number |
integer | No | Block containing this transaction (null if pending) |
confirmations |
integer | Yes | Number of confirmations (0 for pending) |
status |
string | Yes | "pending", "confirmed", "failed", "dropped" |
from |
object | Yes | Sender information (address, balance) |
to |
object | No | Recipient information (null for contract deployment) |
amount |
object | Yes | Transfer amount with currency and value |
fee |
object | Yes | Transaction fee paid |
metadata |
object | No | Blockchain-specific additional data |
Complete Transaction Example: Ethereum Transfer
{
// WIA Standard version
"wia_version": "1.0",
// Transaction identification
"transaction_id": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef1234567890abcdef1234567890",
"blockchain": "ethereum",
"network": "mainnet",
"type": "transfer",
// Timing and confirmation
"timestamp": "2025-12-25T10:30:00.000Z",
"block_number": 18500000,
"block_hash": "0xabcdef...",
"confirmations": 12,
"status": "confirmed",
// Sender (from)
"from": {
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"balance_before": "10.500000000000000000",
"balance_after": "9.498000000000000000"
},
// Recipient (to)
"to": {
"address": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"balance_before": "5.000000000000000000",
"balance_after": "6.000000000000000000"
},
// Transfer amount
"amount": {
"value": "1.000000000000000000",
"currency": "ETH",
"decimals": 18,
"usd_value": "3500.00",
"usd_timestamp": "2025-12-25T10:30:00Z"
},
// Transaction fee
"fee": {
"value": "0.002000000000000000",
"currency": "ETH",
"decimals": 18,
"usd_value": "7.00",
"gas_used": "21000",
"gas_price": "100000000000"
},
// Ethereum-specific metadata
"metadata": {
"nonce": 42,
"gas_limit": "21000",
"chain_id": 1,
"v": "0x1b",
"r": "0x...",
"s": "0x...",
"input": "0x"
}
}
4.2 Bitcoin Transaction Example (UTXO Model)
Bitcoin uses a fundamentally different transaction model called UTXO (Unspent Transaction Outputs). Unlike Ethereum's account-based model, Bitcoin transactions consume previous outputs and create new ones. WIA-FIN-003 represents this elegantly while maintaining format consistency.
{
"wia_version": "1.0",
"transaction_id": "d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5",
"blockchain": "bitcoin",
"network": "mainnet",
"type": "transfer",
"timestamp": "2025-12-25T10:30:00Z",
"block_number": 820000,
"block_hash": "00000000000000000001a2b3c4d5e6f7...",
"confirmations": 6,
"status": "confirmed",
// Bitcoin uses inputs (spending UTXOs) instead of single "from"
"inputs": [
{
"previous_output": {
"txid": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
"vout": 0
},
"address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"amount": {
"value": "1.50000000",
"currency": "BTC",
"decimals": 8,
"usd_value": "67500.00"
},
"script_sig": "483045022100...",
"sequence": 4294967295
}
],
// Bitcoin creates multiple outputs
"outputs": [
{
"address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",
"amount": {
"value": "1.00000000",
"currency": "BTC",
"decimals": 8,
"usd_value": "45000.00"
},
"script_pubkey": "76a914...",
"vout": 0
},
{
// Change output back to sender
"address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"amount": {
"value": "0.49950000",
"currency": "BTC",
"decimals": 8,
"usd_value": "22477.50"
},
"script_pubkey": "76a914...",
"vout": 1
}
],
"fee": {
"value": "0.00050000",
"currency": "BTC",
"decimals": 8,
"usd_value": "22.50"
},
"metadata": {
"version": 2,
"locktime": 0,
"size": 226,
"vsize": 226,
"weight": 904,
"witness": []
}
}
4.3 UTXO Model Deep Dive
Understanding the UTXO model is crucial for working with Bitcoin and similar blockchains. In this model, a "coin" is not tracked by account balance but rather by unspent outputs from previous transactions.
UTXO Transaction Flow:
Transaction 1 (Previous):
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Outputs: โ
โ [0] Alice โ 1.5 BTC โ (Unspent) โ
โ [1] Bob โ 0.3 BTC (Already spent)โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ (Alice spends UTXO)
Transaction 2 (Current):
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Inputs: โ
โ โข Tx1[0]: 1.5 BTC (from Alice) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Outputs: โ
โ [0] Carol โ 1.0 BTC โ (New UTXO) โ
โ [1] Alice โ 0.4995 BTC โ (Change) โ
โ โ
โ Fee: 0.0005 BTC (1.5 - 1.0 - 0.4995)โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Key UTXO Concepts
- Inputs Reference Previous Outputs: Each input points to a specific output from a previous transaction using
(txid, vout)pair. - Outputs Must Be Fully Spent: You cannot partially spend a UTXO. If you have 1.5 BTC and want to send 1.0 BTC, you must spend the entire 1.5 BTC output and create a "change" output back to yourself.
- Implicit Fees: Transaction fee is the difference between input sum and output sum. It's not explicitly stated but implied.
- Script Locking: Each output is "locked" with a script (scriptPubKey) that defines spending conditions. Input provides a script (scriptSig) to "unlock" it.
UTXO Set
The UTXO set is the collection of all unspent transaction outputs in the blockchain. This set represents the current state of who owns what in Bitcoin. Full nodes maintain this set in memory for fast transaction validation.
| UTXO Reference | Address | Amount (BTC) | Block Height |
|---|---|---|---|
| tx123...:0 | 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa | 0.49950000 | 820000 |
| tx456...:1 | 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 | 1.00000000 | 820000 |
| tx789...:0 | 1HQ3Go3ggs8pFnXuHVHRytPCq5fGG8Hbhx | 2.50000000 | 819995 |
4.4 Address Normalization
Different blockchains use different address formats. WIA-FIN-003 normalizes these into a consistent structure while preserving blockchain-specific information.
Universal Address Format
{
"wia_version": "1.0",
"address": {
"raw": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"blockchain": "ethereum",
"network": "mainnet",
"type": "eoa", // Externally Owned Account (vs. contract)
"checksummed": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"validation": {
"is_valid": true,
"checksum_valid": true
}
}
}
Address Types Across Blockchains
| Blockchain | Example Address | Format | Length |
|---|---|---|---|
| Bitcoin (P2PKH) | 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa | Base58Check | 26-35 chars |
| Bitcoin (P2SH) | 3J98t1WpEZ73CNmYviecrnyiWrnqRhWNLy | Base58Check | 26-35 chars |
| Bitcoin (Bech32) | bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4 | Bech32 | 42-62 chars |
| Ethereum | 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb | Hexadecimal | 42 chars |
| Solana | 7EqQdEULxWcraVx3mXKFqJy6z3bK4W5X2LjBqQKx8zQ5 | Base58 | 32-44 chars |
| Cardano | addr1qxy...xyz | Bech32 | Variable |
Bitcoin Address Types Explained
- P2PKH (Pay to Public Key Hash): Original format, starts with "1". Example: 1A1zP1eP...
- P2SH (Pay to Script Hash): Multisig and complex scripts, starts with "3". Example: 3J98t1W...
- Bech32 (SegWit): Native SegWit, lower fees, starts with "bc1". Example: bc1qw508...
- Taproot (P2TR): Latest format for privacy and efficiency, also Bech32. Example: bc1p5d7r...
4.5 Token Metadata Schema
Beyond native blockchain currencies (BTC, ETH), most blockchains support custom tokens. WIA-FIN-003 provides a standard format for describing these tokens.
{
"wia_version": "1.0",
"token": {
"contract_address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"blockchain": "ethereum",
"network": "mainnet",
"standard": "ERC-20",
"details": {
"name": "Tether USD",
"symbol": "USDT",
"decimals": 6,
"total_supply": "95000000000.000000",
"logo_uri": "https://assets.example.com/usdt.png"
},
"market_data": {
"price_usd": "1.00",
"market_cap_usd": "95000000000",
"volume_24h_usd": "50000000000",
"circulating_supply": "95000000000.000000",
"timestamp": "2025-12-25T10:30:00Z"
},
"metadata": {
"verified": true,
"issuer": "Tether Limited",
"website": "https://tether.to",
"whitepaper": "https://tether.to/wp-content/uploads/2016/06/TetherWhitePaper.pdf"
}
}
}
Token Standards Across Blockchains
| Blockchain | Fungible Tokens | Non-Fungible Tokens | Notes |
|---|---|---|---|
| Ethereum | ERC-20 | ERC-721, ERC-1155 | Most widely adopted standards |
| Binance Smart Chain | BEP-20 | BEP-721 | Compatible with ERC standards |
| Solana | SPL Token | Metaplex NFT | Different architecture than EVM |
| Cardano | Native Tokens | Native NFTs | First-class token support |
| Polkadot | PSP-22 | PSP-34 | Substrate-based standards |
4.6 Block Structure
WIA-FIN-003 also standardizes how blocks themselves are represented, enabling blockchain explorers and analytics tools to work across different blockchains.
{
"wia_version": "1.0",
"block": {
"blockchain": "ethereum",
"network": "mainnet",
"number": 18500000,
"hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"parent_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"timestamp": "2025-12-25T10:30:00Z",
"miner": {
"address": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"reward": {
"value": "2.5",
"currency": "ETH",
"usd_value": "8750.00"
}
},
"transactions": {
"count": 150,
"transaction_ids": [
"0x1a2b3c4d...",
"0x5e6f7g8h...",
// ... (truncated for brevity)
]
},
"statistics": {
"size_bytes": 125000,
"gas_used": "15000000",
"gas_limit": "30000000",
"difficulty": "58750000000000000",
"total_difficulty": "58750000000000000000000"
},
"metadata": {
"extra_data": "0x...",
"nonce": "0x1234567890abcdef",
"mix_hash": "0x..."
}
}
}
4.7 Validation Rules
All WIA-FIN-003 data must pass rigorous validation. The standard provides JSON Schema definitions for automated validation.
Transaction Validation Checklist
Required Field Validation
- โ
wia_versionmust match supported version (currently "1.0") - โ
transaction_idmust be valid hash for specified blockchain - โ
blockchainmust be from allowed list - โ
timestampmust be valid ISO 8601 format - โ
statusmust be one of: "pending", "confirmed", "failed", "dropped"
Amount Validation
- โ
amount.valuemust be positive number - โ
amount.decimalsmust match currency specification - โ
amount.currencymust be valid ticker symbol - โ USD values must include timestamp for price reference
Address Validation
- โ Address format must match blockchain specification
- โ Checksum validation for formats that support it (Ethereum, Bitcoin Bech32)
- โ Network identifier must match address prefix (mainnet vs. testnet)
UTXO-Specific Validation (Bitcoin)
- โ Input references must point to existing, unspent outputs
- โ Sum of outputs must not exceed sum of inputs
- โ Fee must be positive (inputs sum - outputs sum > 0)
- โ Scripts must be valid and properly formatted
Example Validation Code (TypeScript)
import Ajv from 'ajv';
import { wiaTransactionSchema } from '@wia/schemas';
const ajv = new Ajv();
const validate = ajv.compile(wiaTransactionSchema);
function validateWIATransaction(data: any): boolean {
const valid = validate(data);
if (!valid) {
console.error('Validation errors:', validate.errors);
return false;
}
// Additional business logic validation
if (data.blockchain === 'bitcoin') {
return validateBitcoinUTXO(data);
} else if (data.blockchain === 'ethereum') {
return validateEthereumAddress(data);
}
return true;
}
4.8 Implementation Examples
Converting blockchain-specific data to WIA format is straightforward. Here are examples for major blockchains.
Bitcoin to WIA Conversion
async function convertBitcoinToWIA(bitcoinTx: BitcoinTransaction): Promise {
return {
wia_version: "1.0",
transaction_id: bitcoinTx.txid,
blockchain: "bitcoin",
network: "mainnet",
type: "transfer",
timestamp: new Date(bitcoinTx.blocktime * 1000).toISOString(),
block_number: bitcoinTx.blockheight,
confirmations: bitcoinTx.confirmations,
status: bitcoinTx.confirmations > 0 ? "confirmed" : "pending",
inputs: bitcoinTx.vin.map(input => ({
previous_output: {
txid: input.txid,
vout: input.vout
},
address: input.address,
amount: {
value: input.value.toFixed(8),
currency: "BTC",
decimals: 8,
usd_value: (input.value * btcPrice).toFixed(2)
},
script_sig: input.scriptSig.hex,
sequence: input.sequence
})),
outputs: bitcoinTx.vout.map(output => ({
address: output.scriptPubKey.addresses[0],
amount: {
value: output.value.toFixed(8),
currency: "BTC",
decimals: 8,
usd_value: (output.value * btcPrice).toFixed(2)
},
script_pubkey: output.scriptPubKey.hex,
vout: output.n
})),
fee: {
value: calculateFee(bitcoinTx).toFixed(8),
currency: "BTC",
decimals: 8
}
};
}
4.9 Benefits of Standardized Data Formats
The practical benefits of Phase 1 implementation are substantial and immediate:
- Unified Analytics: Build one analytics platform that works across all blockchains instead of separate dashboards for each chain.
- Simplified Wallets: Multi-chain wallets can use a single codebase for transaction history, balance tracking, and display.
- Cross-Chain DEX: Decentralized exchanges can list assets from multiple blockchains with consistent data handling.
- Regulatory Compliance: Tax reporting and audit tools work across all cryptocurrency holdings without chain-specific plugins.
- Developer Experience: New developers learn one format instead of mastering dozens of blockchain-specific schemas.
- API Aggregation: Services can aggregate data from multiple blockchain APIs into a single, consistent format for clients.
4.10 Getting Started with Phase 1
Ready to implement WIA-FIN-003 Phase 1 in your project? Follow these steps:
Step 1: Install the WIA SDK
npm install @wia/cryptocurrency-standard
# or
pip install wia-cryptocurrency-standard
# or
go get github.com/wia-official/cryptocurrency-standard
Step 2: Import Schemas and Validators
import {
WIATransaction,
validateTransaction,
convertBitcoinToWIA,
convertEthereumToWIA
} from '@wia/cryptocurrency-standard';
Step 3: Convert Your Data
const ethTx = await web3.eth.getTransaction(txHash);
const wiaFormat = convertEthereumToWIA(ethTx);
if (validateTransaction(wiaFormat)) {
// Store, display, or process the standardized data
await database.transactions.insert(wiaFormat);
}
Step 4: Test Your Implementation
npm run wia:test
# Runs validation against official test vectors
๐ Chapter Summary
- Universal Transaction Schema provides blockchain-agnostic format with required fields for transaction_id, blockchain, network, type, timestamp, status, amounts, and fees.
- UTXO Model representation handles Bitcoin-style blockchains where transactions consume previous outputs and create new ones, with implicit fees calculated from input/output differences.
- Address Normalization standardizes diverse formats across blockchains (Base58Check for Bitcoin, hexadecimal for Ethereum, Bech32 for SegWit) into consistent structure.
- Token Metadata Schema describes custom tokens with contract addresses, standards (ERC-20, SPL, etc.), supply information, and market data.
- Block Structure standardization enables cross-chain block explorers and analytics tools with unified representation of block headers, transaction lists, and mining data.
- Validation Rules ensure data quality through JSON Schema validation, checksum verification, amount validation, and blockchain-specific rules.
- Implementation examples demonstrate conversion from Bitcoin and Ethereum native formats to WIA standard using SDK helper functions.
- Immediate practical benefits include unified analytics, simplified wallets, cross-chain compatibility, easier compliance, and improved developer experience.
โ Review Questions
- What are the required fields in the WIA Universal Transaction Schema? Explain the purpose of each and why blockchain-agnostic design is important.
- Explain the UTXO model used by Bitcoin. How does it differ from Ethereum's account model, and how does WIA-FIN-003 represent both in a unified format?
- Describe the three main Bitcoin address types (P2PKH, P2SH, Bech32). What are their differences, and how does WIA normalize them?
- How are transaction fees handled differently in Bitcoin vs. Ethereum? How does the WIA standard represent fees consistently across both?
- What is the UTXO set, and why is it important? How would you query an address's balance using the UTXO model versus the account model?
- Walk through the process of converting a native Ethereum transaction to WIA format. What information needs to be added, transformed, or calculated?
๐ฎ Looking Ahead
With a solid understanding of Phase 1 data formats, Chapter 5 will explore Phase 2: API & Communication Layer. We'll examine how WIA-FIN-003 standardizes RESTful APIs, WebSocket protocols, authentication mechanisms, and best practices for building interoperable cryptocurrency services.
You'll learn about endpoint design patterns, real-time event streaming, rate limiting strategies, pagination approaches, and error handling conventions that enable seamless integration between different cryptocurrency platforms and applications.