Skip to main content

Quick Start

Get started with Hoosat development in minutes! This guide will help you choose the right tool and make your first blockchain interaction.

Choose Your Tool

Hoosat provides multiple ways to interact with the blockchain. Choose based on your use case:

For Server-Side Applications

Perfect for backend services, APIs, and automation.

Install:

npm install hoosat-sdk

Basic Example:

import { HoosatClient } from 'hoosat-sdk';

// Connect to node via gRPC
const client = new HoosatClient({
host: 'localhost',
port: 42420
});

// Get node info
const info = await client.getNodeInfo();
console.log('Node version:', info.serverVersion);

// Get address balance
const balance = await client.getBalance('hoosat:qp...');
console.log('Balance:', balance);

// Send transaction
const txId = await client.sendTransaction({
to: 'hoosat:qp...',
amount: 100000000 // 1 HTN in sompi
});
console.log('TX ID:', txId);

Features:

  • ✅ Full gRPC connection to Hoosat node
  • ✅ Real-time event streaming
  • ✅ Transaction building and signing
  • ✅ Wallet management
  • ✅ Fee estimation

Full Node.js SDK Documentation →

Network Configuration

Mainnet

  • Node gRPC: localhost:42420 (default)
  • REST API: https://proxy.hoosat.net/api/v1
  • Network ID: mainnet
  • Currency: HTN
  • Explorer: (coming soon)

Testnet

  • Node gRPC: localhost:52420
  • REST API: (not available yet)
  • Network ID: testnet
  • Get test coins: (faucet coming soon)

Common Operations

Check Balance

const balance = await client.getBalance('hoosat:qp...');
console.log('Balance:', balance);

Send Transaction

const txId = await client.sendTransaction({
to: 'hoosat:qp...',
amount: 100000000 // 1 HTN = 100,000,000 sompi
});

Get Transaction Status

const tx = await client.getTransaction(txId);
console.log('Status:', tx.isAccepted ? 'Confirmed' : 'Pending');

Key Concepts

HTN and Sompi

  • 1 HTN = 100,000,000 sompi
  • Sompi is the smallest unit (like satoshi in Bitcoin)
  • All amounts in APIs are in sompi
// 1 HTN
const amount = 100000000; // sompi

// 0.5 HTN
const halfHTN = 50000000; // sompi

// 1.25 HTN
const oneAndQuarter = 125000000; // sompi

Addresses

Hoosat addresses use Bech32m encoding:

hoosat:qp4ad2eh72xc8k9vyqm5...
  • Prefix: hoosat:
  • Public key hash encoded in Bech32m

Transactions

UTXO-based model (like Bitcoin):

  • Inputs: Previous outputs being spent
  • Outputs: New outputs being created
  • Fee: Difference between inputs and outputs

Fees

  • Measured in sompi
  • Typical fee: 1000-5000 sompi (0.00001-0.00005 HTN)
  • Higher fee = faster confirmation

Next Steps

For Developers

  1. Building a backend service?

  2. Building a web app?

  3. Using another language?

  4. Building a DApp?

For Users

Getting Help

Need assistance?

Example Projects

Coming soon:

  • Simple wallet application
  • Payment gateway integration
  • DApp with wallet extension
  • Block explorer
  • Transaction monitor