Towns Protocol Bot SDK for Openclaw

A comprehensive development toolkit for building interactive, blockchain-integrated bots on the Towns Protocol using the Bun runtime and Base network.

andreyz
v2.0.0
Jan 12, 2026
1
2.3k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install towns-protocol

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install towns-protocol using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Towns Protocol Bot SDK?

The Towns Protocol Bot SDK skill provides developers with the essential framework to build and deploy sophisticated bots within the Towns ecosystem. This skill focuses on the core pillars of Towns integration, including secure authentication via Ethereum addresses, a unique two-wallet architecture for gas management, and seamless interaction with the Base network. By utilizing Openclaw Skills, developers can ensure their bots are configured correctly from the start, avoiding common pitfalls like silent failures or gas issues.

This skill simplifies the complexities of blockchain-based messaging by providing clear patterns for handling slash commands, interactive forms, and real-time reactions. It emphasizes technical accuracy and best practices, such as verifying transaction receipts before granting permissions, making it an indispensable resource for anyone building decentralized social applications.

Towns Protocol Bot SDK Use Cases

  • Implementing automated moderation and community engagement tools using message handlers.
  • Processing and verifying on-chain tips and transactions directly within chat interfaces.
  • Creating interactive user experiences through forms and custom slash commands.
  • Managing decentralized community access based on real-time blockchain state.

How Towns Protocol Bot SDK Works

  1. Scaffolding: Use the Bun runtime to initialize a new bot project with the official Towns SDK.
  2. Configuration: Securely set up environment variables for credentials and Base network RPC access.
  3. Implementation: Define a command registry and bind handlers for various event types like onMessage and onSlashCommand.
  4. Wallet Setup: Fund the Viem gas wallet with Base ETH to facilitate on-chain operations.
  5. Event Processing: Capture and respond to user interactions, reactions, and transaction requests.
  6. Deployment: Launch the bot using a webhook-capable environment while monitoring transaction statuses.

Towns Protocol Bot SDK Setup

Initialize your project with the following commands:

bunx towns-bot init my-bot
cd my-bot
bun install

Ensure your environment variables are configured in your .env file to enable the full power of Openclaw Skills:

APP_PRIVATE_DATA=<base64_credentials>
JWT_SECRET=<webhook_secret_min_32_chars>
BASE_RPC_URL=https://base-mainnet.g.alchemy.com/v2/YOUR_KEY

Towns Protocol Bot SDK Data Schema & Taxonomy

The skill organizes its operations around specific Ethereum-based identifiers and event structures for maximum compatibility with the Base network.

Property Format Description
User ID Ethereum Address Always 0x format, used for all identification instead of usernames
Gas Wallet Viem Account Wallet used to sign and pay for blockchain gas fees
Treasury App Address Optional wallet for receiving transfers or holding assets
Interaction JSON Payload Structured data for forms, transactions, and signatures

Towns Protocol Bot SDK Advanced Features

  • Advanced two-wallet architecture for clear separation of gas fees and treasury funds.
  • Interactive form support using specific type properties for dynamic user input.
  • Secure on-chain verification patterns using transaction receipts to ensure data integrity.
  • Enhanced mention support requiring both string formatting and metadata array inclusion.
  • Seamless integration with Openclaw Skills for automated bot logic generation and deployment.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*