We introduce Circles, a new currency framework that leverages modern cryptography to build trust without centralized gatekeepers. By decentralizing money creation, Circles distributes the privilege of issuing currency to every individual, fostering a more inclusive and resilient monetary system.
Circles is built on a few powerful principles that make money creation fair, efficient, and resilient. By moving money creation from centralized institutions to individuals—and by harnessing real-life trust—Circles reimagines currency.
Build on the Circles Protocol
About Circles
Under the hood, Circles relies on five simple rules:
Universal access allows anyone to open an account.
Distributed issuance grants each account the right to mint 1 CRC per hour.
Demurrage applies a 7 % yearly decay to every CRC, preventing early adopters from dominating the supply.
A Rule of Trust lets users swap CRC 1:1 along their social trust graph, so individual non-fungible “personal monies” converge into a commonly spendable currency.
Members of a Circles Groups can mint a shared CRC backed by members’ coins, giving communities their own monetary layer.
Circles also uses an invitation system for onboarding: existing users invite newcomers by paying 96 CRC, while the invitee receives 48 CRC as a welcome bonus. This helps protect network integrity and creates a meaningful cost to discourage spam accounts and Sybil style abuse.
Because payments flow along real-world social links, Circles is both resilient and versatile. Trust can be revoked at any time, shielding honest users from malicious actors, yet the transitive nature of swaps means you can still pay strangers seamlessly. Groups and Organizations add a “fast lane” for adoption: they pool liquidity, act as local or thematic currencies, and let communities balance efficiency against security. The result is a self-governing monetary network in which issuance, security and economic coordination rest with the people who use it.
This documentation helps developers explore Circles’ capabilities and delve into the Circles SDK and its various components.
Understanding Personal and Group Currencies
In Circles, money is generated collectively by many individuals over time rather than by a central authority at specific events.
When you become part of the Circles network, every person has their own personal Circles token and receives one Circle (CRC) per hour, unconditionally.
The trust network forms a social graph where each trust relationship acts as a link, allowing tokens to flow between individuals through these connections. This ensures that the value of Circles is supported by genuine social relationships, fostering a community-driven economy.
At the same time, this mechanism is an effective soft sybil protection, as it decentralises the verification process and relies on human judgment for trust, preventing fake accounts from compromising the network. Since the connections between Circles accounts have a limited capacity (defined by their balances of fungible tokens), this limits the impact of fake accounts that manage to get trusted by a credible member of the network to their direct surroundings.
Personal Currencies and Trust Path
Personal currencies are unique and require trust to be transferred to others. To send tokens, other users must first trust your personal currency. When someone trusts your tokens, they become fungible with their own tokens.
This fungibility allows for the transfer of tokens along a trust path, enabling transactions even between people who do not directly trust each other.
Group Currencies
Additionally, Circles v2 introduces support for group currencies, allowing communities to share a currency backed by their members' personal tokens.
This collective currency reduces risk, simplifies payments, and enhances market creation by aggregating individual tokens into a more stable and fungible group currency. Group currencies make it easier to integrate Circles into existing economic structures and protocols, further promoting a robust and interconnected community economy.
Group Currencies
In addition to individual CRC currencies, Circles has introduced the concept of Group Avatars and Currencies. The idea behind Group currencies is to aggregate social-economic value amongst groups, without the geographical bounds of where groups are generated or created. Group avatar tokens can't be minted based on time, rather they depend on collateral deposits from trusted tokens.
Group participation operates through Circles' trust network rather than formal membership. To receive and accept group tokens, you need to trust the group address, which allows you to hold and transact with their tokens. The group, in turn, must trust the types of tokens it will accept as collateral for minting.
Group token minting is a permissionless process open to anyone holding tokens that the group trusts. When you want to mint group tokens, you deposit your trusted tokens (which can be personal CRC, other group tokens, or any Circles tokens) as collateral through the groupMint() function. The group mints new group tokens proportional to the collateral deposited, while your collateral tokens are held in the group's treasury.
This is not a direct swap but rather a collateralization mechanism - your original tokens remain in the group's treasury and can be redeemed later by burning group tokens through the groupRedeem() function. The current system allows minting based on any quantity of trusted Circles tokens you hold, not limited to personal CRC tokens.
The trust relationships work bidirectionally: you trust the group to accept their tokens, and the group trusts specific token types to accept them as collateral. This creates a flexible, decentralized system where group currencies can be backed by diverse collateral from across the Circles ecosystem, enabling economic coordination without geographic or membership constraints.
Inviting and accepting human avatars
Circles allows you to join the network as a human with a token ERC 1155 standard. You would have a profile and would require to be invited to join the network and start minting personal CRC token
Trust determines which avatars will accept Circles issued by others. Circles SDK exposes avatar.trust helpers that batch safely (via Safe runner) or send single transactions (via EOA runners) while keeping expiry handling consistent and default under the hood.
Add Trust
Trusting an avatar means you are willing to accept Circles they issue, transfers from them or along paths that rely on them are allowed while the trust is active.
Passing an array batches all trust updates into one Safe transaction. EOA runners only support single addresses per call.
Remove Trust
Check Trust Direction
Inspect All Trust Relations
getAll() returns aggregated links where relation is one of:
trusts – avatars you trust.
trustedBy – avatars that trust you.
mutuallyTrusts – avatars where trust is bidirectional.
Get token balances of an avatar
You can use the avatar.balances helpers to read Circles balances with automatic v1/v2 handling. These methods rely on RPC only and work as soon as the SDK instance is initialized with a runner.
Automatically checks the correct hub version based on avatar.avatarInfo.
Returns the sum of all Circles holdings (unwrapped + wrapped) for the avatar address.
Get Token Balances
Returns an array of TokenBalanceRow entries for every token relevant to the avatar in the current context.
Managing group invites
Base groups “invite” members by trusting their personal avatars; members must also trust the group avatar to mint group tokens as collateral.
Invite a Member (Trust Them)
Trusting a member signals that the group will accept their personal token as collateral.
Safe runners can batch invites: groupAvatar.trust.add(['0xA', '0xB']);.
Member Accepts (Trust the Group)
Members must trust the group avatar before they can mint group tokens.
Revoke a Member (Untrust Them)
Batching works the same way: groupAvatar.trust.remove(['0xA', '0xB']);.
Getting total supply of group tokens available
Use balances.getTotalSupply() on avatars that expose a minted token (currently Base Groups).
Get Total Supply for a Base Group
import { Sdk, BaseGroupAvatar } from '@aboutcircles/sdk';
const sdk = new Sdk({ rpcUrl: 'https://rpc.aboutcircles.com' }, runner);
const avatar = await sdk.getAvatar('0xGroupAddress');
if (avatar instanceof BaseGroupAvatar) {
const totalSupply = await avatar.balances.getTotalSupply();
console.log('Total group token supply:', totalSupply.toString());
} else {
console.log('Total supply is only available for BaseGroup avatars.');
}
Returns the ERC‑1155 total supply for the group’s token ID.
If you call getTotalSupply() on a Human or Organisation avatar you’ll receive an unsupportedOperation error; use balance methods (balances.getTotal, balances.getTokenBalances) instead for those types.
Organization Avatars
In the Circles SDK, an Organization Avatar represents a non-human entity within the ecosystem. Unlike human or group avatars, it has distinct capabilities:
Cannot mint tokens
Can participate in the trust network
Supports profiles for organization
Unlike group avatars, organizations don't have membership conditions. Organizations are designed to represent entities that participate in the Circles economy without issuing their own currency.
Creation of Organizations
Organizations join Circles without invitations and don’t mint personal tokens.
Circles is all about creating a fairer money system. Our current monetary system and most cryptocurrencies tend to benefit those with established wealth and market positions, making it challenging for newcomers to catch up. Wealth grows disproportionately for those already in the market, as time in the market often beats time to market.
Circles aims to solve this by ensuring equal opportunity for all. Each user continuously generates tokens at a rate of one Circle (CRC) per hour, regardless of when they join. Additionally, existing Circles incur a demurrage fee of 7% per year. By tying the issuance of tokens to time, a resource everyone has, Circles promotes fairness by giving everyone a chance to accumulate tokens and encouraging the active circulation of currency.
Issuance
Circles employs a unique token issuance mechanism where each user generates their own currency (CRC) at a steady rate of one token per hour. The minting rules are encoded in the so-called Hub, a token factory from which all individual Circles tokens are created.
All tokens existing in the system are ultimately rooted in personal tokens (Circles v1 only includes personal tokens, while v2 adds group currencies which are collateralized by personal tokens).
Demurrage
All tokens are automatically demurred at a rate of 7% per year.
For human users, the demurrage is offset by the steady income of new CRC. Only after minting for 80 years (roughly a human lifespan) or through economic activity can a person become negatively affected by demurrage. Once the person dies, no new tokens are minted and all of the person's tokens are subjected to demurrage.
Organizations cannot mint tokens. Therefore, their balance is always subject to a demurrage of 7% per year.
The following graph visualizes the balance of an account over time, assuming no economic activity and continuous minting of all CRC.
If understood as a tax, then the tax would be negative at first (you get money), but once your balance reaches the threshold of 125.000 Circles, it turns positive (you loose money).
Circles v2 is built on the ERC1155 token standard. Here, the Hub uses a standard allowance to facilitate path transfers. The token metadata mimics as profile.
In Circles v2, there is a limit that allows a maximum minting amount of 14 days' worth of Circles. Minting can be stopped manually if required.
Why Build on Circles?
Circles is a decentralized protocol with a social and economic value for humans, communities and groups. Circles is not a crypto startup or product in general, but a collective effort to bring a fair distribution model for the money created, owned and shared by people.
Explore our developer documentation, and join us in our mission to create a fair and sustainable economy for all.
Circles Architecture
An overview of different components of circles architecture.
A flow of architecture for Circles Protocol
Circles V2 Core Components
The Circles Stack
Developers Hub for building with Circles.
Our developer documentation portal provides comprehensive guide to build using Circles SDK, SDK references, contract addresses, and code examples to help you integrate Circles into your applications and build upon our ecosystem.
If you want to develop a server or client application that utilizes Circles, and allow you to utilize trust connection and personal/group currencies, then Circles SDK would be your entry point. Based on your need, you can pick to develop any avatar post initialization of SDK.
Circles SDK Overview
The is a TypeScript library that allows you to integrate Circles protocol into your dApp to implement avatars, profiles, token transfers and build trust connections for your use-case. Under the hood, Circles SDK utilizes deployed hub contracts on Gnosis Chain, pathfinder for finding trust network paths and profile service and Circles RPC.
To use the Circles sdk, install the primary npm package
Features:
Instantiate Sdk once and work with human, organization, or group avatars through a unified interface.
Building with different Circles Avatars
An avatar represents a Circles user.
The SDK is built around the concept of avatars. An avatar is a Circles user and is used to interact with other Avatars.
New Circles users must sign up.
For existing Circles users, you can simply get exisiting avatars by address.
Creating a new avatar
You will need a Metamask account with some xDAI to be able to interact with contracts and follow along the steps. Make sure you configured MetaMask with Gnosis chain before you continue.
Transfer personal Circles tokens to different avatar
You can use avatar.transfer utilities to reason about and send Circles with or without pathfinding.
Pathfinder-based max flow from your avatar to a recipient:
Computes the largest flow permitted by your trust graph and current balances.
Selects routes through trusted avatars and wrapped tokens automatically.
Group Avatars
Group avatars are a type of avatar in the Circles ecosystem that represent collective entities rather than individual users.
Group Structure
Each group in Circles has:
A unique blockchain address (similar to individual avatars)
A specific type identifier
An owner who has administrative control
A treasury where tokens are stored
A mint policy that governs token creation
A name and symbol for its tokens
A membership system
Groups also maintain a count of their members and can store metadata via IPFS CIDs (Content Identifiers).
Minting: Groups can mint their own tokens using collateral from members
Redemption: Members can redeem group tokens for the underlying collateral
Groups within the Circles ecosystem serve several important purposes:
Enabling Collective Economic Action: Groups allow multiple individuals to create shared economic entities with their own currencies, extending Circles beyond personal tokens.
Creating Community Currencies: Groups can mint their own tokens backed by collateral, allowing communities to create currencies tailored to their specific needs.
Pooling Resources: The group treasury system allows pooling of resources from members.
Create Base Groups for your community
They can set membership conditions to define who can be part of the group
They can register short names with a nonce
They can trust avatars individually or in batches with condition checks.
sdk.register.asGroup
Mint group tokens
Mint Base Group tokens by sending collateral through the trust graph to the group’s mint handler. The groupToken helpers on HumanAvatar and OrganisationAvatar handle pathfinding and wrapped balances automatically.
Uses the pathfinder to route collateral (including wrapped tokens) to the group’s mint handler.
It will fail if trust or liquidity is insufficient to deliver the requested amount.
Find groups and memberships
You can use the RPC helpers on sdk.rpc.group to search for Base Groups and to fetch memberships for an avatar. These methods work with cursor-based pagination via PagedQuery.
Initialize RPC Access
import { Sdk } from '@aboutcircles/sdk';
import { CirclesRpc } from '@aboutcircles/sdk-rpc';
// Preferred: reuse the RPC client from an SDK instance
const sdk = new Sdk({ rpcUrl: 'https://rpc.aboutcircles.com' });
const rpc = sdk.rpc;
findGroups(limit, params?) pulls pages under the hood and returns up to limit rows.
Get Group Memberships for an Avatar
getGroupMemberships returns a PagedQuery; call queryNextPage() to iterate.
You can continue paging while currentPage?.hasMore is true.
Query Circles profiles
Retrieve user profile data using the Profiles Nethermind plugin. You can:
Create new user profiles
Search existing profiles using parameters such as:
Name
Circles Tools
Circles Tools is acollection of useful tooling for the community. These tools can be used as an extension to the circles core app for niche, specific and advanced usecases.
Here is a detailed list of tools, you can currently use:
Group Checker
This tool displays detailed information about Circles group memberships and token balances. It can fetch on-chain data like ERC20 supplies, fees, and balances using a smart contract and direct links to relevant explorers and swap platforms.
Group Creator
This tool allows users to create Circles groups with customizable metadata and membership conditions. It supports input of service address, group name, symbol, and optional initial trust conditions for setup.
Group Manager
This tool enables group owners to manage and update their Circles group contracts directly from the browser. Owners can view contract details, add or remove trusted members, and modify settings like service or fee collection addresses.
Profile Checker
This tool provides a detailed overview of any address’s Circles v1 and v2 profile details like profile data, token balances, trusted relationships, and live ERC20 prices, including bot classification and expiry info.
Safe State & Tx Hash Checker
This tool allows users to inspect the state of a Gnosis Safe (owners, threshold, nonce) and compute a Safe transaction hash with full control over parameters like gas settings, operation type, and calldata. It also includes an interactive function encoder to help generate calldata from ABI inputs, and shows the full execTransaction calldata when approvals meet the threshold.
Trust Graph Visualizer
This tool visualizes the web of trust relationships in the Circles ecosystem using an interactive force-directed graph. It supports avatars, PageRank-based trust scores, dynamic expansion (recursive and top-ranked), and rich filtering (Humans, Groups, Orgs).
Users can explore any address, see stats and trust rankings in a sortable table, and view incoming/outgoing trust via tooltips and double-click expansion.
Trust Path Visualizer
This advanced visualization tool helps users explore trust flow paths between two Circles addresses using an interactive Sankey diagram.
It calculates on-chain trust paths for a given Circles token transfer amount, retrieves real-time token supply capacities, and visualizes flow bottlenecks.
It’s ideal for understanding how CRC tokens route across trust relationships and for debugging why a transfer may or may not succeed.
Personal CRC Replenisher
This tool lets Circles users replenish their own CRC token balance by routing it through the trust network back to themselves.
It calculates the maximum amount you can send to yourself using existing trust paths, and builds a transaction to call operateFlowMatrix on the Circles Hub.
Circles Backing dApp
This tool allows users to back their Circles tokens (CRC) with real-world assets like WBTC, WETH, GNO, or sDAI through a Safe-based flow on Gnosis Chain. It supports both Safe Apps and MetaMask wallet connections, computes a deterministic CirclesBacking contract address for any given Safe, registers appData with CowSwap to enable post-swap hooks, and guides the user through submitting two required transactions: approve() USDC.e to the factory and safeTransferFrom() CRC tokens via Hub V2.
LBP Starter
This tool helps users easily create and manage Liquidity Bootstrapping Pools (LBPs) using their Circles tokens. It allows local groups or organizations to launch an LBP by selecting a group token (CRC), choosing a paired asset (like sDAI or GNO), specifying the amount of each token, and optionally configuring advanced parameters such as weight curves, swap fees, and duration. It also supports reloading or continuing with existing LBP contracts for inspection or finalization.
Token Distribution Checker
This is an analytics tool for exploring the distribution of ERC-1155 Circles tokens. It allows users to input any Circles-compatible token address and fetch a full breakdown of its holders using the Circles Hub RPC API. The tool visually presents token holdings using a pie chart (with custom legends), paginated data tables, and balance percentages per holder. Each address is enriched with profile names (if available), explorer links, quick copy buttons, and the ability to recursively check other token distributions. Users can export the full dataset as CSV, verify the raw API data via a debug panel, and dynamically navigate token ownership. This tool is ideal for community organizers, protocol designers, or auditors who want transparency and insight into token spread, supply concentration, and holder identity.
Legagacy Circles Safe Creator
This tool is designed to help users deploy a Gnosis Safe (v1.1.1) contract instance with a single owner, tailored for legacy use within the Circles ecosystem. By connecting a MetaMask wallet, users can specify any valid Ethereum address as the owner and generate a new Safe contract using a proxy factory and master copy on Gnosis Chain. The tool handles address validation, transaction submission, and post-deployment verification to confirm that the specified address was correctly set as the owner of the Safe. It is especially useful for onboarding Circles users who need a compatible Safe to manage CRC tokens and interact with legacy dApps.
Onboarding Helper
This tool allows people to easily join a Circles group by scanner a QR code.
Equilibrium Analaysis
This tool provides a dynamic view into market efficiency and arbitrage activity within the Circles economy. It visualizes the moving average of arbitrage profit opportunities over time—expressed in USD—based on configurable time windows, helping identify trends in CRC market imbalances. Simultaneously, it offers a price equilibration analysis by showing the distribution of price spreads between liquid CRC token pairs, flagging deviations from parity using customizable thresholds, liquidity filters, and deviation types (absolute or relative). Together, these insights help traders, analysts, and protocol maintainers detect inefficiencies, monitor arbitrage potential, and assess the overall health of price discovery in the Circles ecosystem.
This is an advanced visualization and simulation tool that computes and displays optimal token transfer paths through the Circles network graph. Users can specify a source address, destination address, and CRC value, along with custom token inclusion filters for both sender and receiver. The tool supports optional wrapped token inclusion and lets users configure visual and performance parameters—such as edge curvature, capacity gradients, node/edge labels, and tooltip details—for clarity and analysis. Upon clicking “Find Path,” the graph engine simulates feasible routes, showing flow capacity and rendering performance in real-time. This makes the Pathfinder useful for debugging trust routes, analyzing payment viability, and exploring how CRC tokens can move through the social trust graph, especially in complex multi-hop scenarios.
Purpose limitation: The Trust Score is provided only for Circles-related trust, anti-abuse, spam and Sybil-resistance use cases (for example, filtering obvious Sybil accounts, protecting community airdrops, or shaping access to Circles-native groups and offers in a proportional way). You must not use it to make or automate unrelated, high-impact decisions about individuals – for example, decisions about employment, housing, off-chain financial products or credit, insurance, access to public services, or other real-world eligibility and access decisions.
Past Hackathon Projects on Circles
Here are some of the past hackathon projects built with Circles. You can use these as a reference or to get inspiration of what kind of applications to build.
1. EthGlobal Brussels 2024
BraceBuddy allows to onboard easily and in a fun way people to the Circles ecosystem with NFC!
Woleth is an easy to use EVM wallet embed into Telegram designed to build a Social Graph utilizing Circle's invite mechanism.
Famjam is a dapp that uses Circles to create a family currency to incentivize kids for good behaviour.
2. EthGlobal Singapore 2024
Voting with UBI is a dapp which implements a voting mechanism for DAOs by utilizing Circles group tokens.
Each user generates tokens continuously at a rate of one Circle (CRC) per hour, ensuring equal opportunity regardless of when they join. This promotes fairness as everyone has a chance to accumulate Circles.
Circles operates on a trust-based model, forming a social graph where users trust each other's CRC tokens. Trusted tokens become fungible, creating a dynamic economy backed by genuine social connections.
Circles integrates a demurrage mechanism, applying a 7% annual fee on held tokens. This keeps the currency circulating, benefiting the overall economy and promoting continuous engagement within the community. For most human users, the fee is offset by the steady income of 1 CRC per hour. Organizations always have to pay the fee.
By decentralising the verification process and leveraging human judgment for trust, Circles addresses the issue of fake accounts. This fosters a secure and resilient ecosystem, where the authenticity of each user is ensured by their social connections rather than centralised authorities or algorithms.
Circles allows creation of group currencies, enabling communities to share a currency that's backed by their members' personal tokens. This reduces risk, simplifies payments, and enhances market creation by aggregating individual tokens into a more stable group currency that's easy to integrate into existing protocols.
By joining the Circles developer community, you can play a crucial role in building a more equitable and inclusive financial system. You can build applications, support developers, and invite more people to join your trust network.
Personal / Human Avatars
ERC-1155 standard avatars, which allows you to mint your personal Circles token (CRC) every hour, accumulating 24 CRC per day with an applied demurrage of 7%.
Group Avatars
Created by an owner, these avatars allow groups to trust human avatars within the group. Group tokens are utilized by collateralizing personal tokens, following the ERC-1155 standard.
Organization Avatars
As an organization, you are an avatar without any minting of new tokens. With your name and metadata file, which will be used for identification and can trust other avatars to receive Circles, with all owned Circles earned by avatars rather than minted.
Collective Governance: Groups implement membership systems that can include conditions and expiry times.
Groups support following CRC token operations:
Understanding purpose of Groups
Implementation
Halting Mint
Hub V2 Contract
An ERC-1155 standard contract for registeration of
human,
groups and
organisation avatars.
Manages trust relations, minting of personal CRC tokens, group currencies and demurrage.
Migration Contract
Allows transition from Legacy V1 hub avatars to V2 hub. Migration will lock V1 CRC tokens, stop minting V1 tokens and convert into V2 tokens.
Name Registry
NameRegistry contract manages names, symbols and metadata for avatars (humans, groups, and organizations).
The name would be of 12 characters with a base58 encoding and store metadata for avatar profiles.
Base Mint Policy
Base mint policy is standard contract is utilized group registration. Once registered the policy address is immutable for the group address. This is a reference implementation for minting, burning and redeeming the group currencies and developers can build their own custom policies as well.
Vaults
Vaults is a factor contract that holds the personal CRC collateral against the group currencies. Every group, there is single vault to query balance. This contract is deployed by Standard treasury and is utilized during redemption of group circles token.
Standard Treasury
The Standard Treasury handles minting and redemption of group Circles by managing collateral transfers. It ensures collateral is forwarded to the correct vault based on structured data from the Hub contract. Additionally, it verifies data during redemption to release or burn collateral as specified by the group's mint policy.
Full Example
wraps profile pinning, factory deployment, and address extraction.
The returned instance is a BaseGroupAvatar, ready for trust, membership, and admin actions.
You can also update metadata with groupAvatar.profile.update({...}), which pins a new CID and updates on-chain metadata via the group contract.
Base Groups are capable of following:
Create a Base Group
Membership Management
Trust Management
Group Administration
Maximum transferable may be lower than your raw balance if trust is missing or tokens are locked in wrappers; check getMaxAmount first.
Bypasses pathfinding; only works if you already hold the target token (personal ERC1155 or wrapped ERC20).
Provide a token address to send wrapped balances or omit to use your personal token.
Get Maximum Transferable Amount
Transfer CRC with Pathfinding
Direct Token Transfer (Specific Token)
CID (Content Identifier)
Description
Wallet Address
💡 Query Circles Profiles
1. Create a Profile (POST request)
2. Get a Profile by CID (GET request)
3. Get Multiple Profiles by CIDs (GET request)
4. Search Profiles by Name (GET request)
5. Search Profiles by Description (GET request)
6. Search Profiles by Address (GET request)
7. Search Profiles by CID (GET request)
8. Search Profiles with Multiple Criteria (GET request)
This will compute the largest flow to the group’s mint handler with the current trust relations and balances.
// Send your personal CRC directly (no pathfinding)
await avatar.transfer.direct('0xRecipient', BigInt(5e18));
// Send a specific wrapped token directly
await avatar.transfer.direct('0xRecipient', BigInt(5e18), '0xWrappedToken');
Circles protocol relies on the hub contract that you can utilize directly within applications. These deployed contracts exist on Gnosis Chain and are required by the SDK for configuration and initialization.
Here are the deployed addresses for V1 hub and V2 hub that you should consider for configuration or building tools on Circles protocol:
Contract Name
Deployed addresses
Hub contract
0xc12C1E50ABB450d6205Ea2C3Fa861b3B834d13e8
Name registry
0xA27566fD89162cC3D40Cb59c87AAaA49B85F3474
Migration contract
0xD44B8dcFBaDfC78EA64c55B705BFc68199B56376
If you want to skip directly to setting up Circles SDK in your application, you can jump to the SDK Configuration Guide which covers all the setup parameters.
To collaborate with fellow developers, ask questions, and share your insights, join our technical community channels on Discord, GitHub, and other platforms.
Circles tokens (CRC) are primarily ERC‑1155 balances, but most DeFi tooling expects ERC‑20s. Wrapping converts CRC into ERC‑20 wrappers so you can reach AMMs, lending markets, or bridges while keeping Circles' properties.
Why wrap?
AMMs and routers typically accept only ERC‑20 tokens.
Lending/borrowing markets need ERC‑20 collateral and debt assets.
Bridges and cross‑chain tools usually whitelist ERC‑20s.
Demurraged (decaying): Keeps Circles' time‑based decay. Wrapped balances shrink as demurrage accrues. Use when external protocols should still respect Circles' economics.
Inflationary/static: Balance stays fixed for ERC‑20 compatibility. Use for AMM liquidity, lending collateral, or bridging where decay would break integrations.
Transactions require a configured runner (EOA or Safe) with the SDK.
Deploys (or reuses) a demurraged ERC‑20 wrapper for the avatar’s CRC and transfers the specified amount into it.
Creates or fetches a static ERC‑20 wrapper so balances never decay while wrapped.
Pass the ERC‑20 wrapper contract address you received (via the helper above or your own tracking).
Demurrage continues while wrapped; the redeemable amount may be lower than what was deposited.
Balances are static while wrapped; unwrapping returns the same amount of CRC.
Pick demurraged wrappers to preserve Circles' economic incentives in external protocols; pick static wrappers for maximal ERC‑20 compatibility.
You can wrap any ERC‑1155 Circles token you hold—not just your personal token—by passing its avatar address to asDemurraged or asInflationary.
Store or fetch wrapper addresses for DeFi integrations; use
Subscribing to Avatar events
The Circles SDK let's you subscribe to protocol events. Either filtered for an avatar or as a complete stream. There is also a way to query all past events in a block range.
Subscribe
To subscribe, you need an initialized CirclesData class.
constcirclesRpc=newCirclesRpc("
constcirclesRpc=newCirclesRpc("
Then call the subscribeToEvents() method and supply the address of the avatar to subscribe to:
You can omit the last parameter (toBlock) to query from fromBlock to the latest block:
The above methods yield CirclesEvents. All events have at least the following base properties:
$event: CirclesEventType One of the event types listed below
blockNumber: number In which block the event occurred
timestamp?: number When the event occurred
Here's a list of all event types. Please refer to the for the event properties.
Personal / Human Avatars
Circles SDK exposes human avatars through the HumanAvatar class, which implements the AvatarInterfaceV2 contract. Each instance wraps the Circles V2 hub contracts, profile service, and pathfinding helpers so apps can manage invitations, minting, trust, and transfers with minimal boilerplate.
Invitation-based onboarding – every human avatar must be invited by an existing avatar that escrows 100 CRC via avatar.invite.send.
Using CrcV2_TransferData for verifying annotated data
Annotating Circles transactions with arbitrary data and utilizing CrcV2_TransferData rpc method to build Gnosis App compatible payment links and QR codes with annotation.
This starter kit showcases a simple method for Circles transaction based data transfer: execute a transfer via Gnosis, then verify on-chain intent by polling Circles events for CrcV2_TransferData and matching recipient + data.
The core idea is simple:
Treat transfer data as an application-level idempotency key.
@aboutcircles/sdk-types
TypeScript type definitions
@aboutcircles/sdk-utils
Utility functions
@aboutcircles/sdk-runner
Safe multisig wallet integration for executing blockchain operations with the Circles SDK.
@aboutcircles/sdk-transfers
Builds Circles SDK transfer payloads by combining pathfinding results with the data and RPC utilities needed to execute a transfer.
Base mint policy
0xcCa27c26CF7BAC2a9928f42201d48220F0e3a549
Pathfinder
Finds liquid paths between two accounts in the trust network. These paths are used as input for the contract's transfer methods.
Profile-backed identities – v2 humans always reference an IPFS CID (pinned through the Profiles service) that stores metadata such as name, description, and media URLs.
Personal token minting – humans accrue up to 24 CRC per day and can mint accumulated issuance via avatar.personalToken.mint.
Trust graph participation – avatar.trust.add/remove/isTrusting manages bilateral trust needed for pathfinding and transfers.
Transfer orchestration – avatar.transfer.direct and avatar.transfer.advanced support both direct CRC transfers and multi-hop, wrapped-balance flows.
Human avatars retrieved from Sdk#getAvatar or CirclesRpc.avatar.getAvatarInfo surface an AvatarRow payload. V2 humans are tagged with CrcV2_RegisterHuman events and look like:
avatar / tokenId – human avatars use their address as the ERC‑1155 token id.
cidV0 – IPFS CID pointing to the profile JSON; cidV0Digest is the on-chain metadata digest.
hasV1 – indicates whether the address has a legacy v1 identity that can still be migrated.
timestamp, blockNumber, logIndex – useful for freshness checks or historical queries.
Invite the new human – the inviter uses an existing HumanAvatar (fetched via Sdk#getAvatar) and escrows 100 CRC:
Register / accept invitation – the invitee calls sdk.register.asHuman. Pass either an existing CID or a Profile object; the SDK auto-pins profile objects to the Circles profile service before registering with the hub.
avatar.profile.get() – fetches and caches the IPFS JSON referenced by cidV0.
avatar.profile.update(profile) – pins new metadata and updates the NameRegistry digest; useful for avatar name/description/image changes.
sdk.register.asHuman(inviter, profileOrCid) – automatically uses the Profiles service when a plain object is supplied, so invitees do not need prior CID knowledge.
Establish trust through avatar.trust.add('0xFriend...', expiry?), remove trust via avatar.trust.remove, and inspect relationships using avatar.trust.getAll() or avatar.trust.isTrusting.
Transfer CRC with avatar.transfer.direct('0xRecipient...', 25n * 10n ** 18n) for simple paths, or avatar.transfer.advanced to opt into wrapped balances, token filters, or encoded metadata.
Replenish personal (unwrapped) CRC by converting wrapped holdings with avatar.balances.replenish(); the SDK uses the pathfinder to determine the optimal flow back to the avatar’s personal token.
It computes candidate representations for the target string and attempts reverse decode (hex -> utf8) on event payloads. This reduces false negatives when wallet/indexer pipelines emit different encodings for semantically identical content.
usePaymentWatcher(...) executes recursive polling with timeout scheduling:
Starts only when enabled && dataValue && minAmountCRC.
Sets state to waiting before each probe.
Calls checkPaymentReceived(...).
On hit: stores event, sets confirmed, stops polling.
On exception: stores message, sets error, keeps control explicit.
On cleanup: cancels loop and clears timeout.
Default interval is 5000ms; this is configurable via intervalMs.
The important field is data. For production, use structured unique values (order:<uuid>, invoice:<tenant>:<id>) to avoid ambiguous confirmations.
This way we can implement Gnosis App integrated payments utilizing Circles.
Here is a simple fun game utilizing the above discussed features:
Using this any arbitrary data can now be annotated with Circles transactions.
npm install
npm run dev
{
"jsonrpc": "2.0",
"id": 1,
"method": "circles_events",
"params": [
"<recipient-or-cursor-or-null>",//We can also add other params like fromBlock, toBlock, etc
null,
null,
["CrcV2_TransferData"]
]
}
Event Ingestion: circles_events with CrcV2_TransferData
Matching Semantics (Critical Path)
Data normalization
Proper encoding and decoding standards will also be introduced soon for different data types.
Polling Loop and State Machine
Deep Link Construction and Correlation Key
Pathfinder
Circles pathfinder calculates “how much and through which tokens can flow from A to B” based on trust and balances (wrapped and unwrapped). You can use it to:
Preview a route and achievable amount.
Feed TransferBuilder or custom operateFlowMatrix calls.
Token pinning/bans: Use fromTokens/toTokens to force specific personal or group tokens; use the exclude* variants to forbid costly or undesired wrappers.
Easiest: call TransferBuilder.constructAdvancedTransfer(from, to, amount, options)—it runs findPath, adds unwrap/rewrap, approvals, and returns an ordered tx array.
Manual: convert PathfindingResult to operateFlowMatrix:
createFlowMatrix(from, to, maxFlow, transfers) – turns a PathfindingResult into flowVertices, flowEdges, streams, packedCoordinates for hubV2.operateFlowMatrix.
maxFlow === 0: check mutual trust or unwrap static/demurraged balances back to ERC1155.
Paths needing wrapped balances will fail unless useWrappedBalances is true.
Utilising CirclesQuery Class
The CirclesQuery class allows you to execute custom queries against the Circles RPC api.
The previously shown CirclesData class returns CirclesQuery<T> objects for all paged query results. You can execute custom queries against all tables in the Circles index and filter with them.
Write a query
First you'll need to define a query. The basic structure of a query is the same as for a basic SQL select. It has the following fields:
namespace: Used to distinguish between tables and views as well and to tell the tables of the two Circles version apart from each other.
table: The name of the table you want to query.
columns: A list of column names you want to select.
filter: A list of filter conditions that must be met.
sortOrder: Can be 'asc' or 'desc'.
limit: How many rows to return (max: 1000).
Here is a query that reads all avatars with type group. Other avatar types you can try are human and organization.
You can define a type for the rows of your query, or just go with any if the type doesn't matter.
If you want to specify a custom type, it must extend the EventRow type. The EventRow type contains the blockNumber, transactionIndex and logIndex fields which are required for pagination.
To execute the query definition, you'll need a CirclesRpc instance. Create one and pass the Circles rpc url to the constructor.
Then create a CirclesQuery<MyGroupType> instance.
Call getNextPage() to retrieve the first page of the result set. You can then access the results through the currentPage property. This property includes the results themselves, along with firstCursor, lastCursor, limit, size, and sortOrder.
You can extend the CirclesQuery with computed columns. Computed columns are defined by a callback that takes in the row and returns a new value. Here we convert the value of the previously queried cidV0Digest field (which is originally a hex-string) to a CID in Qm.. format.
The new column should be added to the custom type.
Then you can execute the query just like you did before. The calculated column function will be executed for each row in a page.
Glossary
This glossary contains terms and definitions used throughout the Circles documentation.
ERC-1155 is an Ethereum token standard that enables the efficient transfer and bundling of multiple fungible and non-fungible tokens in a single transaction. This multi-token standard allows for the creation of complex token systems, such as those used in gaming or supply chain management, where different types of tokens need to be managed simultaneously.
The standard introduces a new set of functions, including safeTransferFrom, safeBatchTransferFrom, and balanceOfBatch, which allow for the transfer and querying of multiple token balances in a single call. This reduces gas costs and simplifies token management compared to using multiple ERC-20 or ERC-721 contracts.
ERC-1155 tokens are identified by a unique combination of an address and an ID, allowing for the creation of an unlimited number of token types within a single contract. The standard also includes an optional metadata extension, enabling developers to associate additional information, such as images or descriptions, with each token type.
An externally-owned account (also known as EOA) is one of the two types of Ethereum accounts. A private key controls it; it has no code, and users can send messages by creating and signing Ethereum transactions.
Gasless transactions (also known as meta-transactions) are Ethereum transactions that are executed by a third party called relayer on behalf of a smart account to abstract the use of gas. Users must sign a message (instead of the transaction itself) with information about the transaction they want to execute. A relayer will create the Ethereum transaction, sign and execute it, and pay for the gas costs. The main benefit is that users can interact with the blockchain without holding the native token in their account.
A blockchain network is a collection of interconnected computers that utilize a blockchain protocol for communication. Decentralized networks allow users to send transactions, that are processed on a distributed ledger with a consensus mechanism ensuring the batching, verification, and acceptance of data into blocks. This structure enables the development of applications without the need for a central authority or server.
A Safe owner is one of the accounts that control a given Safe. Only owners can manage the configuration of a Safe and approve transactions. They can be either externally-owned accounts or smart accounts. The threshold of a Safe defines how many owners need to approve a Safe transaction to make it executable.
A relayer is a third-party service acting as an intermediary between users' accounts and blockchain networks. It executes transactions on behalf of users and covers the associated execution costs, which may or may not be claimed.
Safe is a smart contract wallet that requires a minimum number of people to approve a transaction before it can occur (M-of-N). If for example you have 3 main stakeholders in your business, you are able to set up the wallet to require approval from 2 out of 3 (2/3) or all 3 people before the transaction is sent. This assures that no single person could compromise the funds.
A smart account (also known as a smart contract account) leverages the programmability of smart contracts to extend its functionality and improve its security in comparison with externally-owned accounts. Smart accounts are controlled by one or multiple externally-owned accounts or other smart accounts, and all transactions have to be initiated by one of those.
Some common features that smart accounts offer to their users are:
Safe is one of the most trusted implementations of a smart account.
A transaction is an action initiated by an externally-owned account to update the state of the EVM network. Transaction objects must be signed using the sender's private key, require a fee, and be included in a validated block.
A Safe transaction is a transaction sent to a Safe Proxy contract calling the execTransaction method.
The threshold of a Safe account is a crucial configuration element that enables using Safe as a multi-signature smart account. It defines the number of required confirmations from the Safe owners a (Safe) transaction must have to be executable.
A wallet is an interface or application that gives users control over their blockchain account. Wallets allow users to sign in to applications, read their account balance, send transactions, and verify their identity.
If you want to be able to load the next page (queryNextPage()) you must always include the following fields in your query:blockNumber, transactionIndex, logIndex.
Define a row type
Execute the query
Add computed columns
import { CirclesRpc } from '@aboutcircles/sdk-rpc';
const rpc = new CirclesRpc('https://rpc.circlesubi.network/');
const path = await rpc.pathfinder.findPath({
from: '0xSender',
to: '0xRecipient',
targetFlow: BigInt('10000000000000000000'), // 10 CRC
useWrappedBalances: true,
fromTokens: ['0xPreferredToken'], // optional pin
excludeToTokens: ['0xAvoidToken'], // optional ban
maxTransfers: 4
});
console.log(path.maxFlow); // bigint achievable
console.log(path.transfers); // [{ from, to, tokenOwner, value }]
If no env values are supplied, src/lib/circles.ts defaults to staging RPC and a hardcoded recipient.
Query Circles Data
The CirclesData class provides an easy-to-use selection of common queries that are suitable for most use cases.
Initialization
Most of the previously shown avatar methods internally use the CirclesData class with filters for the current avatar address. If you already have a configured Sdk instance, you can use the sdk.data property to access the class:
const data = sdk.data;
Otherwise you can also create an instance like this:
const circlesRpc = new CirclesRpc("https://rpc.aboutcircles.com/");
const data = new CirclesData(circlesRpc);
Get avatar info
The getAvatarInfo(avatar: string): Promise<AvatarRow | undefined> method finds basic information about an avatar. This includes the signup timestamp, circles version, avatar type (human, organization or group), and token address/id as well as it's profile CID (if any).
const avatarInfo = await data.getAvatarInfo("0x...");
if (avatarInfo) {
console.log("Avatar is signed up at Circles");
} else {
console.log("Avatar is not signed up at Circles");
}
Get token info
The getTokenInfo(tokenId: string): Promise<TokenInfoRow | undefined> methods finds basic information about a Circles token. This includes the creation timestamp, circles version, token type (human or group) and the address of the avatar that created the token.
The total Circles balance of an avatar is the sum of all it's personalized and group token holdings. It can be queried with the getTotalBalance(avatar:string): Promise<string> method. There is a separate method for each Circles version.
In contrast to the above method, the getTokenBalances(avatar: string): Promise<TokenBalanceRow[]> method gives a detailed overview of an avatar's Circles holdings. As with the method above, this one also exists for both versions of the Circles protocol.
The result row contains the token, balance and the tokenOwner.
The getTransactionHistory(avatar: string, pageSize: number): CirclesQuery<TransactionHistoryRow> method can be used to query all incoming and outgoing Circles transfers from and to an avatar. This includes minting and transfers of personal and group Circles for v1 and v2.
The result rows have the following properties:
timestamp When the transaction happened
transactionHash
version If the transaction happened in Circles v1 or v2
The results are ordered in descending order.
The getTrustRelations(avatar: string, pageSize: number): CirclesQuery<TrustListRow> method can be used to query the effective trust events for an avatar. Already expired or removed trust relations are omitted from the results.
In contrast to the above method, this method queries all relevant trust events and groups mutual trust events into a single row instead of one for each direction.
The result rows have the following properties:
subjectAvatar The acting avatar
relation The relation between the acting avatar and the one it's related to
objectAvatar The other avatar
The possible relations are: trusts, trustedBy, mutuallyTrusts, and selfTrusts. The last one (selfTrusts) exists because, in Circles, every avatar trusts itself.
Circles groups have a name and symbol that's stored on-chain. You can use the findGroups(pageSize: number, params: GroupQueryParams): CirclesQuery<GroupRow> method to find groups by name or symbol.
The params parameter can be used to filter and order the result set by the name and symbol of a group.
Use the method as following:
You can query the group memberships of an avatar using the getGroupMemberships(avatar: string, pageSize: number): CirclesQuery<GroupMembershipRow> method to get a list of all groups an avatar is a member of.
The result rows contain the following properties: group, member, expiryTime.
Avatars can invite others to join Circles. The getInvitations(avatar: string, pageSize: number): CirclesQuery<InvitationRow> method returns a list of invitations sent by the specified avatar.
Th e result rows contain the follwing properties: timestamp, transactionHash, inviter, invited.
You can query who invited an other avatar by calling getInvitedBy(avatar:string): Promise<string|undefined>. If the avatar wasn't invited, the method returns undefined.
Circles SDK interface
Sdk class
Constructor: new Sdk(config?: CirclesConfig, contractRunner?: ContractRunner)
config defaults to circlesConfig[100] (Gnosis)
contractRunner required for any state-changing call (see ContractRunner below)
Circles avatars are ERC‑1155 tokens whose metadata field points to an IPFS CID. The JSON stored at that CID contains the human-friendly profile (name, description, images, etc.) that explorers and UIs render. @aboutcircles/sdk exposes helpers on every avatar instance, while @aboutcircles/sdk-profiles provides you a lightweight client for direct pin/get calls.
The profile payload mirrors the Profile interface from @aboutcircles/sdk-types, and the Circles profile service enforces the same shape when accepting uploads.
Avatar interfaces (shared across Human/Organisation/BaseGroup)
balances
trust
profile
history
transfer
wrap
events
Human Avatar specifics
personalToken
groupToken (aliases to group in HumanAvatar)
Organisation Avatar specifics
BaseGroup Avatar specifics
groupToken (group operations)
base group admin (inherited from CommonAvatar group alias)
Notes
operator (the operator that facilitated the transaction - v2 only)
from the sender address
to the receiver address
id in v1: the token address, in v2: the token id
value the transferred raw value for the given version (bigint)
timeCircles a floating point number representation of the value for display purposes
tokenAddress an address representation of the numeric tokenid (v2) or the actual erc20 token address of a v1 personal token
Get total balance (v1, v2)
The methods have a second, optional parameter asTimeCircles?: boolean = true that controls the return value format. The default value (true) returns a floating point number as a string, while false returns a bigint number as a string. If you want to use the value for calculations you need to parse them.
Get detailed token balances (v1, v2)
The methods have a second, optional parameter asTimeCircles?: boolean = true that controls the return value format. The default value (true) returns a floating point number as a string, while false returns a bigint number as a string. If you want to use the value for calculations you need to parse them.
Get transaction history
Get trust relations
The results of this method contain one row per incoming or outgoing event. This is useful when you need to know when a relation was established. However, if you just want to display a contact list you should consider using getAggregatedTrustRelations(avatarAddress: string): Promise<TrustRelationRow[]> instead.
Get aggregated trust relations
Find groups
If an avatar is member at a group (as defined by a trust relation from the group to the avatar), it's usually eligible to mint tokens of that group.
Get group memberships
If you want to query the details of the returned groups, you can pass the group addresses into the groupAddressIn filter field of the findGroups() method.
Returns:subscribeToEvents resolves when WS subscription is active; events is an observable stream of Circles events.
1) getAvatar
2) register.asHuman
3) register.asOrganization
4) register.asGroup
5) profiles.create (global)
6) avatar.profile.update (avatar-bound)
7) tokens.getInflationaryWrapper
8) tokens.getDemurragedWrapper
9) Wrapping (avatar.wrap)
10) Transfers (avatar.transfer)
11) Trust graph (avatar.trust)
12) Balances & history
13) Events
const tokenInfo = await data.getTokenInfo("0x...");
if (tokenInfo) {
console.log("Token is a Circles token");
} else {
console.log("Token is not a Circles token");
}
Must be a base64 data URL that matches the preview requirements below.
For groups, GroupProfile extends Profile with a required symbol property so downstream tools can display the token ticker alongside other metadata.
The SDK automatically creates a Profiles client using the profileServiceUrl from circlesConfig. You can call it directly when building forms or admin panels:
If you already know the CID (for example, you pinned it off-chain), you can fetch it later via await sdk.profiles.get(cid) or through any avatar instance using await avatar.profile.get().
For avatars you control:
Pin the JSON: const cid = await avatar.profile.update(profileData);
The helper converts the CIDv0 into the bytes32 digest (cidV0ToHex) and submits nameRegistry.updateMetadataDigest.
Subsequent reads pull the updated profile, and you can register short names via avatar.profile.registerShortName(nonce) if desired.
You can also skip the pinning step when you already have a CID:
Group metadata uses the same pinning flow, but the registration step also needs the group symbol and deployment parameters for the BaseGroup factory. The SDK’s register.asGroup helper wraps all of that:
register.asGroup pins the groupProfile, deploys the BaseGroup via core.baseGroupFactory, extracts the new group address from the BaseGroupCreated event, and returns a BaseGroupAvatar wired to your runner.
When you embed an image as previewImageUrl, the profile service enforces a few constraints to keep responses lightweight:
Format: PNG, JPEG, or GIF.
Dimensions: exactly 256×256 pixels.
File size: ≤ 150 KB after compression.
Encoding: Base64-encoded data URL (e.g., data:image/png;base64,...).
Here’s a browser-friendly helper that crops and compresses user uploads before pinning:
Profiles that violate those constraints are rejected by the pinning service, so validate on the client and surface helpful errors to your users.
Via avatars:await avatar.profile.get() pulls and caches the current metadata, while avatar.profile.update handles write flows.
Via RPC:CirclesRpc.avatar.getAvatarInfo includes the cidV0 so you can fetch profile blobs without instantiating an avatar class.
Via the profiles client:await sdk.profiles.get(cid) is ideal for batch jobs or server-side verification.
Because the CID is stored on-chain, any tool that knows the avatar address can look up its metadata by combining RPC data with the profile service.
Profile Data Model
import type { Profile, GroupProfile } from '@aboutcircles/sdk-types';
const humanProfile: Profile = {
name: 'John Doe',
description: 'Web3 Developer',
imageUrl: 'https://example.com/image.jpg',
previewImageUrl: 'data:image/jpeg;base64,...',
location: 'Berlin, Germany',
geoLocation: [52.52, 13.4050],
extensions: { twitter: '@john' },
};
const groupProfile: GroupProfile = {
name: 'My Community Group',
symbol: 'MCG',//REQUIRED
description: 'A community group for local initiatives',
imageUrl: 'https://example.com/group-image.jpg',
};
Human-readable location such as "Berlin, Germany".
geoLocation
[number, number]
Tuple of [latitude, longitude].
extensions
Record<string, unknown>
Add your own structured metadata without waiting for schema changes.
Quickstart Guide for Circles SDK
This guide explains how to use the latest @aboutcircles packages to build a browser-ready Circles dApp. Follow the steps to move from wallet prerequisites to a fully initialised Sdk instance capable of handling avatar reads, trust writes, transfers, profile updates, and the auxiliary helper surfaces exposed in v2.
1. Prerequisites
Browser wallet such as MetaMask or Rabby.
Gnosis Chain (chain ID 100) configured inside the wallet. Double-check the RPC endpoint, currency symbol (xDAI), and block explorer entries via the .
A small amount of xDAI for gas (available from the ).
Keep the wallet unlocked in the same browser context that will load your dApp so the runner can interact to window.ethereum.
Install whichever modules you plan to import directly. @aboutcircles/sdk already depends on the others, but pinning them in your app keeps the versions aligned across bundlers.
@aboutcircles/sdk-core – typed contract wrappers plus circlesConfig.
@aboutcircles/sdk-types
Sdk is the primary entry point exposing avatar namespaces (balances, trust, transfer, profile, etc.).
Core/circlesConfig
Need multisig support? @aboutcircles/sdk-runner exports SafeContractRunner (backend) and SafeBrowserRunner (front-end Safe Apps). Swap your custom runner with those when you integrate Safe-based flows.
This object already contains:
Service URLs: circlesRpcUrl (aggregated Circles RPC), pathfinderUrl, and profileServiceUrl.
An EOA runner is ideal for MetaMask/Rabby-style single-signers. The snippet below shows a minimal implementation that satisfies the ContractRunner interface with the help of viem:
Key behaviors:
init() requests wallet access and enforces the correct chain ID before any on-chain action.
sendTransaction() loops through every TransactionRequest emitted by avatar helpers or TransferBuilder, ensuring multi-step flows (pathfinding, wrapped transfers, etc.) complete in order.
Prefer a Safe-based UX? Replace the custom runner with SafeBrowserRunner.create(rpcUrl, window.ethereum, safeAddress, gnosis) (or the server-side SafeContractRunner) from @aboutcircles/sdk-runner. Both satisfy the same interface.
When you need extra control—analytics dashboards, dry-run tooling, custom transfer flows—instantiate the underlying modules alongside the Sdk:
Core returns raw transaction requests for HubV2, BaseGroups, Lift ERC-20 wrappers, etc.
CirclesRpc streams balances, trust graphs, profile search results, and transaction history straight from the Circles indexers.
Reuse the same config everywhere to avoid mismatched service URLs.
Passing circlesConfig[100] explicitly removes any ambiguity about the targeted environment.
Provide your custom (or Safe) runner so avatar helpers can sign and broadcast state-changing transactions. If you leave the runner undefined, the SDK functions remain read-only.
sdk.data exposes RPC-backed helpers for avatars, trust, and balances when you do not need a full avatar instance.
This pattern maps cleanly to a React useEffect, a Next.js server action (with a server-side runner), or a plain script.
Pick the surfaces that match your UX:
HumanAvatar / OrganisationAvatar / BaseGroupAvatar – mint issuance, manage trust, transfer CRC, wrap/unwrap, and maintain profiles with type-specific helpers.
sdk.register – onboard new humans, organisations, and base groups while handling invitation escrows and profile pinning.
sdk.data – lightweight RPC views for trust graphs, balances, and avatar metadata (great for dashboards).
Decide which combos your application needs up front so you can import only the modules you plan to expose.
Circles Events Types
All events listed below extend this CirclesBaseEvent structure.
$event (CirclesEventType): Discriminator for the event kind.
transactionIndex (number): The transaction index within the block.
logIndex (number): The log index within the transaction.
timestamp (number | optional): Timestamp (when provided by the source).
transactionHash (string | optional): The transaction hash.
Events related to the creation and management of Avatars, Groups, and Organizations.
Emitted when a new human avatar is registered.
$event: 'CrcV2_RegisterHuman'
avatar (string): The address of the registered human.
inviter (string): The address of the user who invited them.
Emitted when a new group is registered.
$event: 'CrcV2_RegisterGroup'
group (string): The address of the group.
mint (string): The address of the mint policy.
treasury (string): The treasury address.
name (string): The name of the group.
symbol (string): The token symbol.
Emitted when an organization is registered.
$event: 'CrcV2_RegisterOrganization'
organization (string): The address of the organization.
name (string): The name of the organization.
Emitted when an invitation is sent to a potential user.
$event: 'CrcV2_InviteHuman'
inviter (string): The address sending the invite.
invited (string): The address being invited.
Emitted when a short name (alias) is registered.
$event: 'CrcV2_RegisterShortName'
avatar (string): The avatar address.
shortName (bigint): The numeric representation of the short name.
nonce (bigint): The nonce used for registration.
Emitted when an avatar status is set to stopped.
$event: 'CrcV2_Stopped'
avatar (string): The address of the avatar that has stopped.
Events regarding the movement and minting of tokens (ERC-1155 compliant).
Emitted when a user mints personal circles.
$event: 'CrcV2_PersonalMint'
human (string): The address of the human minting.
amount (bigint): The amount minted.
startPeriod (bigint): The start of the minting period.
endPeriod (bigint): The end of the minting period.
Emitted when tokens are minted via a Group context.
$event: 'CrcV2_GroupMint'
sender (string): The address initiating the mint.
receiver (string): The address receiving the tokens.
group (string): The group address.
collateral (bigint): The collateral amount involved.
amount (bigint): The amount minted.
batchIndex (number): The index within the batch operation.
Emitted when a single token ID is transferred.
$event: 'CrcV2_TransferSingle'
operator (string): The address performing the transfer.
from (string): The source address.
to (string): The destination address.
id (bigint): The token ID.
value (bigint): The amount transferred.
Emitted when multiple token IDs are transferred simultaneously.
$event: 'CrcV2_TransferBatch'
batchIndex (number): The index within the batch operation.
operator (string): The address performing the transfer.
from (string): The source address.
to (string): The destination address.
id (bigint): The token ID.
value (bigint): The amount transferred.
Emitted when an operator is approved to manage all assets.
$event: 'CrcV2_ApprovalForAll'
account (string): The account owner.
operator (string): The address being approved.
approved (boolean): Status of approval (true/false).
A high-level summary event for transfers.
$event: 'CrcV2_TransferSummary'
from (string): The source address.
to (string): The destination address.
amount (bigint): The aggregated amount.
events (string): Encoded reference to related sub-events.
Events related to the wrapping of Circles tokens into standard ERC20 format.
Emitted when a new ERC20 wrapper contract is deployed.
$event: 'CrcV2_ERC20WrapperDeployed'
avatar (string): The avatar associated with the wrapper.
erc20Wrapper (string): The address of the deployed wrapper contract.
circlesType (number): The type identifier for the circles.
Emitted when tokens are transferred via the wrapper.
$event: 'CrcV2_Erc20WrapperTransfer'
tokenAddress (string): The address of the token.
from (string): The source address.
to (string): The destination address.
value (bigint): The value transferred.
Events tracking value conversions between inflationary and demurraged states.
Emitted when inflationary tokens are deposited.
$event: 'CrcV2_DepositInflationary'
account (string): The user account.
amount (bigint): The raw amount deposited.
demurragedAmount (bigint): The equivalent demurraged value.
Emitted when inflationary tokens are withdrawn.
$event: 'CrcV2_WithdrawInflationary'
account (string): The user account.
amount (bigint): The raw amount withdrawn.
demurragedAmount (bigint): The equivalent demurraged value.
Emitted when demurraged tokens are deposited.
$event: 'CrcV2_DepositDemurraged'
account (string): The user account.
amount (bigint): The demurraged amount deposited.
inflationaryAmount (bigint): The equivalent inflationary value.
Emitted when demurraged tokens are withdrawn.
$event: 'CrcV2_WithdrawDemurraged'
account (string): The user account.
amount (bigint): The demurraged amount withdrawn.
inflationaryAmount (bigint): The equivalent inflationary value.
Emitted to record the cost associated with discounting.
$event: 'CrcV2_DiscountCost'
account (string): The user account.
id (bigint): The token ID.
cost (bigint): The calculated cost.
Events regarding social graphs, data streams, and IPFS metadata.
Emitted when a trust relationship is modified.
$event: 'CrcV2_Trust'
truster (string): The entity giving trust.
trustee (string): The entity receiving trust.
expiryTime (bigint): Timestamp when the trust expires.
Emitted when a token stream is finalized.
$event: 'CrcV2_StreamCompleted'
operator (string): The address finalizing the stream.
from (string): The source address.
to (string): The destination address.
id (bigint): The token ID.
amount (bigint): The total amount streamed.
batchIndex (number | optional): The index if part of a batch.
Emitted when a single flow edge scope begins.
$event: 'CrcV2_FlowEdgesScopeSingleStarted'
flowEdgeId (bigint): The ID of the flow edge.
streamId (number): The ID of the stream.
Emitted when the last flow edge scope ends.
$event: 'CrcV2_FlowEdgesScopeLastEnded'
(No specific payload properties defined beyond base event)
Emitted when an avatar's metadata hash is updated.
$event: 'CrcV2_UpdateMetadataDigest'
avatar (string): The avatar address.
metadataDigest (Uint8Array): The new metadata hash.
Emitted regarding IPFS Content ID (v0) updates.
$event: 'CrcV2_CidV0'
avatar (string): The avatar address.
cidV0Digest (Uint8Array): The IPFS CID v0 digest.
Emitted when the URI for a token ID changes.
$event: 'CrcV2_URI'
value (string): The URI string.
id (bigint): The token ID.
Emitted when a new vault is created.
$event: 'CrcV2_CreateVault'
vault (string): The address of the new vault.
token (string): The associated token address.
Base Event Configuration
1. Identity & Registration
CrcV2_RegisterHuman
CrcV2_RegisterGroup
CrcV2_RegisterOrganization
CrcV2_InviteHuman
CrcV2_RegisterShortName
CrcV2_Stopped
2. Token Operations (Standard & Batch)
CrcV2_PersonalMint
CrcV2_GroupMint
CrcV2_TransferSingle
CrcV2_TransferBatch
CrcV2_ApprovalForAll
CrcV2_TransferSummary
3. ERC20 Wrappers
CrcV2_ERC20WrapperDeployed
CrcV2_Erc20WrapperTransfer
4. Inflation & Demurrage
CrcV2_DepositInflationary
CrcV2_WithdrawInflationary
CrcV2_DepositDemurraged
CrcV2_WithdrawDemurraged
CrcV2_DiscountCost
5. Trust, Flows & Metadata
CrcV2_Trust
CrcV2_StreamCompleted
CrcV2_FlowEdgesScopeSingleStarted
CrcV2_FlowEdgesScopeLastEnded
CrcV2_UpdateMetadataDigest
CrcV2_CidV0
CrcV2_URI
6. System & Vaults
CrcV2_CreateVault
– shared types including
ContractRunner
,
TransactionRequest
, and avatar data models.
@aboutcircles/sdk-runner – production runners (SafeContractRunner, SafeBrowserRunner) and error helpers.
@aboutcircles/sdk-rpc – typed JSON-RPC client for balances, trust graphs, pathfinding, transactions, and events.
@aboutcircles/sdk-transfers – TransferBuilder orchestration around pathfinding + wrapper management; it leans on…
@aboutcircles/sdk-pathfinder – utilities for flow matrices, wrapper lookups, and path manipulation.
@aboutcircles/sdk-profiles – profile pinning client that the SDK uses internally for metadata updates.
viem – RPC + wallet tooling shared by the runner implementations.
provide production-ready contract addresses, service URLs, and default RPC endpoints.
ContractRunner defines the interface your signing strategy (EOA, Safe, hardware wallet, …) must satisfy.
CirclesRpc, TransferBuilder, and Profiles are optional direct imports when you need to bypass the high-level helpers (analytics views, offline tooling, custom flows).
viem primitives make the runner portable across browser wallets and Node environments.
,
baseGroupFactoryAddress
,
baseGroupMintPolicy
,
standardTreasury
,
coreMembersGroupDeployer
, and
liftERC20Address
.
Metadata used internally by TransferBuilder, CirclesRpc, and the avatar helpers (so you rarely need to hard-code addresses).
Gas estimation, read-only calls, and ENS resolution are delegated to viem so you do not need to reinvent RPC plumbing.
to create the ordered transaction list (unwraps, approvals,
operateFlowMatrix
) without sending anything.
Profiles is handy for batch jobs or when you want to pin metadata outside of the avatar helpers.
sdk.tokens contains convenience helpers for wrappers and token-holder pagination.
sdk.groups helps explore group treasuries, membership lists, and holder breakdowns without writing direct RPC calls.
sdk.profiles offers direct create/get helpers powered by @aboutcircles/sdk-profiles.
sdk.tokens – wrapper lookups plus cursor-based holder queries for ERC1155/ERC20 representations.
sdk.groups – fetch group members, treasury balances, and holder distributions without juggling contracts manually.
sdk.profiles – talk to the profile service directly when you need to pin/update metadata outside avatar flows.
import { Sdk } from '@aboutcircles/sdk';
import { Core, circlesConfig, type CirclesConfig } from '@aboutcircles/sdk-core';
import type { ContractRunner } from '@aboutcircles/sdk-types';
import { createPublicClient, createWalletClient, custom, http } from 'viem';
import { gnosis } from 'viem/chains';
// Optional modules for lower-level access when you need them
import { CirclesRpc } from '@aboutcircles/sdk-rpc';
import { TransferBuilder } from '@aboutcircles/sdk-transfers';
import { Profiles } from '@aboutcircles/sdk-profiles';
Use the Circles SDK to spend invite quota that an inviter already holds and register new humans on Circles.
This guide covers two onboarding flows:
Existing-wallet users: invite people who already have a Safe wallet.
New users: create referral links for people who do not have a wallet yet.
The SDK prepares the required transaction batch. A runner executes that batch atomically through the inviter's Safe. You do not need to call the underlying contracts directly.
Scope This guide assumes that the inviter already has invite quota. For getting quota for your community, please reach out to our team on .
The SDK exposes two levels of abstraction:
API
Use it when
Method
Execution behavior
Before using InviteFarm, make sure that:
The inviter already has enough quota for the number of invites.
Your configuration includes referralsServiceUrl.
The inviter's Safe has completed the one-time invitation setup.
Before the inviter sends their first invitation, their Safe must have the InvitationModule enabled and the required module-organization trust configured.
Use Invitations.ensureInviterSetup(inviter) to generate any missing setup transactions, then execute those transactions once.
Create an InviteFarm instance from a CirclesConfig. The config must include referralsServiceUrl, even when you only use farm methods, because InviteFarm internally creates an Invitations instance.
Each quota unit represents one invitation funded with 96 CRC.
Useful helpers:
For batch invitations, validate that the inviter has enough quota for the full batch:
Note A quota check is best-effort. The final debit occurs on-chain when claimInvite() or claimInvites(count) executes. The transaction reverts if the inviter no longer has enough quota.
Use generateInvites for users who already have a Safe wallet but are not yet registered as Circles humans.
The SDK encodes the invitee wallet addresses directly in the transfer data. It does not create accounts for these invitees.
The invitees array must not be empty.
Each invitee must already have a Safe wallet.
Each invitee's Safe must already have the InvitationModule enabled. Use the referral flow for brand-new users instead.
For one invitee, the SDK returns:
For multiple invitees, the SDK returns:
Use generateReferrals for users who do not have a wallet yet.
The SDK creates a temporary keypair for each referral and encodes a ReferralsModule.createAccount() or createAccounts() call. The on-chain flow pre-deploys a claimable Safe for each new user.
generateReferrals returns one referral object per new user:
Each secret is the only way to claim its corresponding pre-deployed account. Persist every secret and deliver it to the intended user through a referral link or QR code.
Warning If a referral secret is lost, the pre-deployed account cannot be claimed.
A new user opens a referral link containing the secret and completes the claim flow:
Create a device WebAuthn passkey.
Sign the module's EIP-712 passkey digest with the referral secret.
Relay ReferralsModule.claimAccount(...).
The claim call has the following shape:
When you already have a runner-backed HumanAvatar, use the high-level API to generate and execute referrals in one call:
The high-level facade also exposes:
For single-invite flows, it also provides:
Both generateInvites and generateReferrals return exactly two transactions:
Always pass the complete array to a runner in a single call:
Use a runner from @aboutcircles/sdk-runner:
SafeContractRunner for server-side execution with a private key.
SafeBrowserRunner for browser-wallet execution.
Important Do not send claimTx and transferTx separately. During the claim, the funding bot grants the inviter temporary trust that is valid only for the current block. The InvitationModule checks that trust when the borrowed CRC arrives. If the transactions are split across blocks, the transfer reverts with TrustRequired.
For every generateInvites or generateReferrals call, InviteFarm performs the following steps:
The SDK calls simulateClaim(inviter, count), which runs an eth_call for claimInvite() or claimInvites(count) with from: inviter.
This simulation determines which farm-bot token IDs will be allocated. The IDs must be known before execution because a Safe batch cannot pass the runtime return value of claimInvites() into the next transfer call.
Allocation is deterministic from the current chain state, so the simulated IDs match the real claim unless a competing claim changes the state first.
For referral flows, the SDK generates one { secret, signer } pair per new user.
The SDK creates:
Each transfer sends 96 CRC per invitation from the inviter to the InvitationModule.
The transfer data depends on the onboarding flow:
Flow
Encoded transfer data
The SDK returns:
For each successful invitation:
The inviter's quota decreases by one.
The farm bot's 96 CRC funds registration and is returned to the bot.
The new human is registered with the original inviter recorded as the permanent inviter.
Package: @aboutcircles/sdk-invitations
config must include referralsServiceUrl.
generateInvites
generateReferrals
High-level, runner-backed facade:
Package: @aboutcircles/sdk-runner
Available Safe runners:
Persist and retrieve referral secrets through the top-level SDK:
Error or symptom
Cause
Resolution
Before shipping an invitation flow, verify that:
The inviter has completed one-time setup.
The inviter has enough quota for the requested batch.
Existing-wallet users go through generateInvites.
Builds and executes the transactions through the avatar's runner.
You have a runner capable of executing the returned transaction array as one atomic Safe batch.
Bind the passkey as the Safe signer.
Receive the 48 CRC welcome bonus.
Complete registration as a self-custodial Circles human with the original inviter recorded as the permanent inviter.
The inviter does not have enough quota when the batch executes
Check getQuota(inviter) before generating the batch and retry with a smaller batch or after quota is added.
FarmIsDrained
The invitation farm does not have enough capacity
Retry after the farm has capacity.
InviteFarm cannot be constructed
referralsServiceUrl is missing from the config
Add referralsServiceUrl to the CirclesConfig.
Referral account cannot be claimed
The referral secret was not stored or was lost
Persist every secret immediately after generating referrals.
New users go through generateReferrals.
Referral secrets are persisted immediately.
The full [claimTx, transferTx] array is executed in one runner call.
Errors such as ExceedsInviteQuota, FarmIsDrained, and TrustRequired are surfaced clearly to users.
InviteFarm from @aboutcircles/sdk-invitations
You manage transaction execution yourself, use a server relayer, or need to inspect or extend the batch
generateInvites(inviter, invitees) or generateReferrals(inviter, count)
Returns unsigned transactions. You pass them to a runner.
HumanAvatar.invitation from the top-level SDK
You already have a runner-backed HumanAvatar and want a build-and-send flow
Existing-wallet user
encodeAbiParameters(['address'], [invitee]) or encodeAbiParameters(['address[]'], [invitees])
const { referrals, transactions } = await farm.generateReferrals(inviterAddress, 25);
// Execute the complete batch atomically.
await runner.sendTransaction(transactions);
// Persist each referral secret so it can be included in a referral link or QR code.
for (const { secret } of referrals) {
await sdk.referrals.store(secret, inviterAddress);
}
type Referral = {
secret: Hex;
signer: Address;
};
ReferralsModule.claimAccount(
x,
y,
verifier,
signature,
metadataDigest,
affiliateGroup?,
);
const { secrets, signers, transactionReceipt } =
await avatar.invitation.generateReferrals(25);
for (const secret of secrets) {
await sdk.referrals.store(secret, avatar.address);
}
claimTx = invitationFarm.claimInvite()
or invitationFarm.claimInvites(count)
transferTx = hubV2.safeTransferFrom(...)
or hubV2.safeBatchTransferFrom(...)