Smart Contract Indexing via Bytecode Landmark Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The indexing of non-fungible tokens (NFTs) is hindered by the lack of standardized contract protocols, making it difficult for conventional indexers to identify and parse transactions involving custom smart contracts, as their contract code is often not publicly verifiable and may be outdated, incomplete, or contain errors.

Innovation Solution

An improved indexing method that identifies custom landmarks in bytecode to recognize transactions and attributes of custom smart contracts without relying on publicly available contract code, by collecting and comparing bytecode samples to determine matching patterns and probabilities, using machine learning models to enhance accuracy.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If conventional indexers use standardized contract protocols for indexing, then indexing efficiency is improved, but the ability to handle custom smart contracts deteriorates

Engineering Contradiction:
Improveindexing efficiencyVSAvoidcustom smart contract compatibility
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The system changes the parameter of contract verification from requiring public standardized protocols to accepting private custom contracts by modifying the indexing approach from protocol-based parsing to bytecode-based landmark detection, enabling handling of non-standardized contracts

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The system introduces bytecode landmarks as an intermediary element that bridges the gap between standardized and custom smart contracts. These landmarks serve as recognizable patterns in bytecode that enable indexing without requiring access to or adherence to public contract code

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If indexers rely on publicly available contract code, then transaction identification accuracy is improved, but reliability deteriorates due to outdated, incomplete, or erroneous code

Engineering Contradiction:
Improvetransaction identification accuracyVSAvoidcontract code availability
Core Design Contradiction:
Measurement precisionVSReliability

Solution Approach 1:

Instead of relying on external public sources of contract code that may be outdated or erroneous, the system creates copies of contract functionality directly from the bytecode embedded in transactions. By extracting and analyzing bytecode landmarks directly from the blockchain, the system eliminates dependency on external code repositories

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The system enables smart contracts to be self-identifying through their bytecode landmarks. Each contract carries its own identification patterns within its bytecode, allowing the indexer to identify and classify transactions without needing external verification or updates from contract authors

Inventive Principle:
Principle #25Self-service

3Adaptability or versatility

If the system analyzes bytecode to identify custom landmarks, then custom smart contract identification capability is improved, but computational complexity increases

Engineering Contradiction:
Improvecustom smart contract identificationVSAvoidindexing system complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The system extracts only the essential identification elements (bytecode landmarks) from the complex bytecode, rather than attempting to fully parse or understand the entire contract logic. This selective extraction simplifies the indexing process while maintaining the ability to identify custom contracts

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The system segments the bytecode analysis process into distinct phases: collecting bytecode samples, identifying landmarks through comparison, and using detected landmarks for transaction identification. This segmentation breaks down the complex task into manageable steps that can be processed efficiently

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS12033144B2Systems and methods for improved indexing of non-standardized, custom smart contracts
Publication Date: 2024.07.09 COINBASE INC
  • US12033144B2 patent drawing
  • US12033144B2 patent drawing
  • US12033144B2 patent drawing

AI summary

Methods and systems for improved indexing of non-standardized, custom smart contracts. The improved indexer identifies custom landmarks (e.g., portions of bytecode indicative of custom smart contract transactions or particular functions in those transactions) that are indicative of transactions involving custom smart contracts (as well as the various attributes of those custom smart contracts). The indexer does this by first collecting bytecode for a subset of known transactions involving the custom smart contracts. The indexer then compares the bytecode of the custom smart contracts in the subset to identify the landmarks or probabilities that portions of the bytecode correspond to landmarks. Once these landmarks are identified (or a probability of the landmark is above a certain threshold), the indexer may designate these as known landmarks. The indexer may then compare the portion of the bytecode corresponding to the known landmark to raw bytecode. Upon detecting a match (or a probability of a match above a certain threshold), the indexer may identify the transaction and/or attributes of the transaction.