Skip to main content

What is Scaffold HBAR?

Scaffold HBAR is an interactive CLI tool (similar to create-next-app or create-react-app) for the Hedera ecosystem. It generates monorepo projects with:
  • Smart contracts (Hardhat or Foundry)
  • Frontend (Next.js App Router with RainbowKit, wagmi, and viem)
  • Hedera network configuration (Testnet or Mainnet with Hashio RPC)
  • Pre-built UI components for wallet connection, address display, and HBAR input

Quick Start

Create your first Hedera dApp in under a minute

Templates

Browse pre-built templates for common use cases

Scaffold UI

Shared components, hooks, and MCP server for AI agents

GitHub

Source code and contributing guide

Quick Start

Prerequisites

Before using Scaffold HBAR, ensure you have:
  • Node.js ≥ 20.18.3 — nodejs.org
  • Git with user.name and user.email configured — git-scm.com
  • Yarn (scaffolded projects use Yarn workspaces):
If you choose Foundry as the Solidity framework:

Create a New Project

Run the CLI with npx:
You’ll be prompted to select:
  1. Project name — Directory name for your new project
  2. Template — Starting point for your dApp (blank, HTS token, NFT, etc.)
  3. Frontendnextjs-app or none (contracts only)
  4. Solidity frameworkfoundry, hardhat, or none
  5. Networktestnet or mainnet
For CI pipelines or scripting, use flags to skip prompts:

Start Development

After scaffolding, start the development servers:
Open http://localhost:3000 to see your dApp.

Available Templates

Scaffold HBAR includes starter templates for common Hedera use cases. The CLI fetches templates dynamically from templates/* branches:
Template selection:
Templates are maintained in the scaffold-hbar repository as separate branches (templates/*). The CLI fetches templates at runtime, so you always get the latest version.

External Templates

Beyond the built-in templates, Scaffold HBAR supports external templates from any GitHub repository. This allows the community to create and share specialized templates.

Using External Templates

Specify an external template using the owner/repo or owner/repo#branch format:
The CLI fetches the template via giget, so any public GitHub repository can serve as a template. The template-hedera-lz-app is a comprehensive tutorial template for building cross-chain applications using LayerZero V2 on Hedera.
What you’ll build: Architecture:
This template uses pnpm (not Yarn) and requires testnet funds on both Base Sepolia and Hedera Testnet. See the template README for complete setup instructions.

Creating Your Own Template

Any GitHub repository can be used as an external template. To make your template compatible:
  1. Structure — Use a monorepo layout with packages/ for contracts and frontend
  2. Manifest (optional) — Add a template.json to specify capabilities:
  1. Share — Users can scaffold with npx create-scaffold-hbar@latest --template your-org/your-repo

Project Structure

A scaffolded project has this structure:

Key Features

Auto-generated Contract Types After deploying contracts, ABIs are automatically generated to packages/nextjs/contracts/deployedContracts.ts. This provides full TypeScript support when interacting with your contracts. Pre-built Hooks The frontend includes scaffold hooks for common operations:
Hedera-Optimized Configuration Projects come pre-configured with:
  • Hashio JSON-RPC endpoints for Testnet and Mainnet
  • Mirror Node API integration
  • Proper gas estimation for Hedera’s fee model
  • RainbowKit with Hedera wallet support

Common Commands


Deploying to Testnet

  1. Get testnet HBAR from the Hedera Portal Faucet
  2. Configure your account:
Set your account alias in packages/foundry/.env:
  1. Deploy to testnet:
  1. Verify contracts (optional):

Hedera Skills (AI-Assisted Development)

All scaffolded projects include Hedera Skills by default—a collection of AI coding assistant skills that help you build on Hedera faster. What’s included:
  • Agent prompts — Pre-configured prompts for Cursor, Claude Code, and other AI assistants
  • Code generation skills — Hedera-specific patterns for HTS, HCS, smart contracts, and more
  • Documentation context — Embedded Hedera docs for accurate AI responses
Skills are installed automatically during scaffolding via:
To skip Hedera Skills installation (e.g., for CI pipelines), use:

Ecosystem

Scaffold UI

Shared React components and hooks for Hedera dApps, plus an MCP server for AI-assisted development

Hedera Skills

AI coding assistant skills for Hedera development

Resources