core

Standardize Valibot schemas for Ethereum base primitive values.

1|Updated Jul 22, 2025
One-click install
npx skills add https://github.com/niconiahi/ethernauta --skill core-niconiahi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: core
Source: https://github.com/niconiahi/ethernauta/tree/main/skills/core
Command: npx skills add https://github.com/niconiahi/ethernauta --skill core-niconiahi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents teams from repeatedly inventing and inconsistently validating low-level Ethereum primitive types (addresses, hashes, byte strings, and unsigned integers) across EIP/ERC/ENS and wallet code.

Core Features & Use Cases

  • Shared primitive schema floor: Centralizes validated Valibot schemas for base types so feature packages reuse them instead of redefining regex checks.
  • Spec-grounded patterns: Derives formats from upstream execution-apis/base-types.yaml, so new primitives stay aligned with the source of truth.
  • Meaning-preserving types: Distinguishes intent with separate schemas even when runtime checks match (for example, differentiating hash semantics from arbitrary 32-byte slots).
  • Composable validation: Supports composing primitives into objects, unions, and tuples for full parameter and response validation at boundaries.

Quick Start

Ask an AI to draft a new composed Valibot schema for an EIP parameter by first selecting the needed primitives from @ethernauta/core and composing them with valibot validators, then deriving the TypeScript type via InferOutput.

Frequently Asked Questions about core

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate Ethereum primitive types like addresses and hashes in TypeScript?

You validate Ethereum primitive types by importing shared Valibot schemas for addresses, bytes, hashes, and unsigned integers from a centralized core catalog, ensuring consistent regex checks across your project. This prevents repeatedly inventing low-level validation logic.

What is the best way to standardize EIP and ERC schema validation across packages?

Standardizing EIP and ERC schema validation involves using a shared primitive schema floor that exports xSchema and x types via InferOutput, allowing feature packages to compose boundaries for JSON-RPC method parameters without redefining checks.

Can I compose Valibot schemas for JSON-RPC method parameters and responses?

Yes, you can compose Valibot schemas for JSON-RPC parameters and responses by selecting base primitives and combining them into objects, unions, and tuples to achieve full validation at boundaries while maintaining meaning-preserving types.

Does this validation approach align with upstream Ethereum execution-apis base types?

Yes, the schema patterns are derived directly from upstream execution-apis/base-types.yaml, ensuring new primitives stay aligned with the source of truth and mirror upstream spec formats for Ethereum base primitive values.

Why distinguish between hash semantics and arbitrary 32-byte slots in schema validation?

Distinguishing hash semantics from arbitrary 32-byte slots provides meaning-preserving types by creating separate schemas even when runtime checks match, preventing teams from inconsistently validating low-level byte strings and hashes.

Do I need Valibot to validate unsigned integers and byte strings for ENS inputs?

Yes, Valibot is required as the validation library to apply the shared catalog of schemas for unsigned integers and byte strings when building or extending packages that define ENS inputs and outputs.