Skip to main content
WSS
Messages
subscribe
type:object
unsubscribe
type:object
subscribe_response
type:object
unsubscribe_response
type:object
update
type:object

Overview

  • Dataset ID: 0121 - Contracts
  • Description: Smart contracts discovered via CREATE/CREATE2 internal transactions. Uses contract_id (26 bytes = address + creation_block + tx_index) as primary key to support metamorphic contracts (e.g. CREATE-SELFDESTRUCT-CREATE2 in the same block).
  • Sample: Hugging Face Sample

Subscription Parameters

chain_id
number
required
Target EVM network. See the Chain enumeration for supported values.
contract_addresses
string[]
Filter notifications to specific deployed contract addresses (hex string, 20 bytes, no 0x prefix).

Message Fields

Payload fields mirror blockdb_evm.b0121_contracts_v1 (binary fields as hex strings without 0x in JSON).
contract_id
string
Contract incarnation ID (hex, 26 bytes): 20 bytes address + 4 bytes creation block + 2 bytes tx index.
contract_address
string
Deployed contract address (hex string, 20 bytes, no 0x prefix).
block_number
number
Block height containing the contract creation.
block_time
string
Block time (ISO-8601).
tx_index
number
Zero-based index of the deployment transaction within the block.
trace_address
string
Position in the call tree (e.g., "0", "0.0", "0.1.2").
creator_address
string
Address that deployed the contract (msg.sender of CREATE/CREATE2). Hex string, 20 bytes, no 0x prefix.
creation_call_type
string
Creation call type (CREATE or CREATE2).
_tracing_id
string
Lineage id (hex).
_created_at
string
Record creation time (ISO-8601).
_updated_at
string
Record last update time (ISO-8601).

Subscription Example

# Use wscat to connect and subscribe
wscat -c wss://api.blockdb.io/v1/evm/ \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -x '{"action": "subscribe", "dataset_id": "0121", "chain_id": 1, "params": {}}'

Response Example

{
  "chain_id": 1,
  "dataset_id": "0121",
  "is_reorg": false,
  "data": {
    "contract_id": "1234567890abcdef1234567890abcdef1234567800121a0700",
    "contract_address": "1234567890abcdef1234567890abcdef12345678",
    "block_number": 18934221,
    "block_time": "2024-04-01T12:34:56Z",
    "tx_index": 7,
    "trace_address": "0",
    "creator_address": "0000000000000000000000000000000000000000",
    "creation_call_type": "CREATE2",
    "_tracing_id": "0121000000000000000000000000000000000001",
    "_created_at": "2025-11-11T18:42:15.123Z",
    "_updated_at": "2025-11-11T18:42:15.123Z"
  }
}
Last modified on April 6, 2026