Skip to main content

Getting Started

Build your first integration with the Integra protocol -- register content, create records, and tokenize assets on-chain.

This guide walks you through the core Integra workflow: registering a content hash, creating a record, and optionally tokenizing it. By the end, you will understand the fundamental building blocks every Integra integration uses.

Prerequisites

Before you start, make sure you have:

  • Solidity fundamentals -- familiarity with smart contract calls, ABI encoding, and bytes32 types
  • An Ethereum library -- ethers.js v6 or viem
  • A wallet -- MetaMask, Coinbase Wallet, or any EVM-compatible wallet
  • Test ETH on Base Sepolia -- the Integra testnet deployment lives on Base Sepolia
  • Node.js 18+ -- for running TypeScript/JavaScript examples

Key Concepts

Before writing any code, understand these three ideas:

Content Hash

A bytes32 value produced by hashing your content with keccak256, sha256, or any deterministic function. The content itself never goes on-chain -- only its fingerprint. This is what gets registered in the existence layer.

bytes32 contentHash = keccak256(abi.encodePacked(documentBytes));

integraHash

A globally unique bytes32 identifier for a record. Think of it as the document's address within the Integra protocol. Every record operation uses the integraHash as its primary key. You generate this yourself -- it must be unique across all records.

Records and Tokenizers

A record (IntegraRecordV1) wraps a content hash with ownership, metadata, and lifecycle management. A tokenizer represents the record as an ERC-20, ERC-721, or ERC-1155 token, enabling it to be transferred, fractionalized, or used as a credential.

The Core Workflow

Every Integra integration follows the same three-step pattern:

Content Hash  --->  Record  --->  Token (optional)
  1. Register the content hash in IntegraExistenceV1 -- immutable, write-once proof that the content existed at a specific time.
  2. Create a record in IntegraRecordV1 -- adds ownership, executor delegation, and resolver bindings.
  3. Tokenize the record via a tokenizer contract -- reserve a token, then claim it with an EAS attestation.

Step 1 happens automatically when you create a record (step 2), but you can also register content hashes independently.

Quick Example: End-to-End Flow

Here is the simplest possible integration -- register a document and create a record, using ethers.js v6:

import { ethers, keccak256, toUtf8Bytes, randomBytes } from "ethers";

// 1. Connect to the network
const provider = new ethers.JsonRpcProvider("https://sepolia.base.org");
const signer = new ethers.Wallet(process.env.PRIVATE_KEY!, provider);

// 2. Instantiate the contracts
const existence = new ethers.Contract(EXISTENCE_ADDRESS, existenceAbi, signer);
const record = new ethers.Contract(RECORD_ADDRESS, recordAbi, signer);

// 3. Hash your content
const documentBytes = toUtf8Bytes("Agreement between Alice and Bob...");
const contentHash = keccak256(documentBytes);

// 4. Generate a unique integraHash and processHash
const integraHash = keccak256(
  ethers.AbiCoder.defaultAbiCoder().encode(
    ["bytes32", "address", "uint256"],
    [contentHash, signer.address, Date.now()]
  )
);
const processHash = keccak256(randomBytes(32));

// 5. Register the record (auto-registers content hash in existence layer)
const tx = await record.registerSimple(
  integraHash,      // unique record identifier
  contentHash,      // content fingerprint
  ethers.ZeroAddress, // no executor
  processHash,      // workflow correlation ID
  ethers.ZeroAddress, // pay fee in ETH
  ethers.ZeroAddress, // owner defaults to msg.sender
  { value: ethers.parseEther("0.001") } // registration fee
);

const receipt = await tx.wait();
console.log("Record created:", integraHash);
console.log("Transaction:", receipt.hash);

// 6. Verify the existence proof
const exists = await existence.exists(contentHash);
console.log("Content exists on-chain:", exists); // true

That is the foundation. From here, you can:

  • Attach a tokenizer to represent the record as a transferable token
  • Add resolvers for compliance, dispute resolution, or contact metadata
  • Delegate to an executor for gasless workflows

What's Next