CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-web3

A Python library for interacting with Ethereum blockchain

Overall
score

88%

Evaluation88%

1.01x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-4/

Ethereum Data Hasher

Build a Python utility that hashes various Ethereum-related data types using cryptographic hashing functions. The utility should handle text strings, byte data, and compute domain-specific hashes for Ethereum name resolution.

Capabilities

Hash text strings

  • Given a plain text string "Hello, Ethereum!", the hash function returns its cryptographic hash as a hexadecimal string @test
  • Hashing an empty string "" returns the hash of the empty input @test

Hash byte data

  • Given raw bytes data, the hash function returns its cryptographic hash as a hexadecimal string @test
  • Hashing bytes representing a function signature produces the expected hash @test

Compute domain name hashes

  • Given a domain name "example.eth", the compute_namehash function returns its namehash as a hexadecimal string @test
  • The namehash for an empty domain ("") should return the zero hash @test

Implementation

@generates

API

def hash_text(text: str) -> str:
    """
    Hash a text string using Ethereum's standard cryptographic hash function.

    Args:
        text: The text string to hash

    Returns:
        Hexadecimal string representation of the hash (with '0x' prefix)
    """
    pass

def hash_bytes(data: bytes) -> str:
    """
    Hash raw bytes data using Ethereum's standard cryptographic hash function.

    Args:
        data: The bytes data to hash

    Returns:
        Hexadecimal string representation of the hash (with '0x' prefix)
    """
    pass

def compute_namehash(domain: str) -> str:
    """
    Compute the namehash for an Ethereum domain name.

    Args:
        domain: The domain name (e.g., "example.eth")

    Returns:
        Hexadecimal string representation of the namehash (with '0x' prefix)
    """
    pass

Dependencies { .dependencies }

web3 { .dependency }

Provides Ethereum blockchain interaction capabilities including cryptographic hashing functions.

Install with Tessl CLI

npx tessl i tessl/pypi-web3

tile.json