AegisAEGIS
Stellar Protocol

Stellar Integration

Cross-border payments, Horizon API balance monitoring, and multi-currency agent economies โ€” near-zero fees with 3-5 second finality.

Why Stellar for Agents?

๐ŸŒ

Built for Cross-Border

Purpose-built for international payments and currency exchange

โšก

3-5 Second Finality

Fast settlement with Stellar Consensus Protocol

๐Ÿ’ฐ

Near-Zero Fees

~$0.00001 per transaction โ€” even cheaper than Solana

๐Ÿ’ฑ

Native Multi-Currency

Trust lines for any issued asset (USDC, EUR, custom tokens)

๐Ÿฆ

Built-in DEX

On-ledger decentralized exchange for currency conversion

๐Ÿงช

Free Testnet

Friendbot provides unlimited testnet XLM for development


What Aegis Uses Stellar For

XLM & Token Balance Monitoring

Query native XLM and trust line token balances via the Horizon REST API using getStellarBalances().

Transaction Verification

Confirm agent payments landed on the Stellar network using verifyStellarTransaction().

Testnet Development

Fund development accounts with free testnet XLM via fundStellarTestnet() using Friendbot.


Use Cases

\uD83C\uDF0D

Cross-Border Agent Economy

Agents in different countries transact using Stellar's native currency exchange. Pay in EUR, receive in USD.

Agent-EU pays Agent-US via XLM bridge

\uD83D\uDCB5

Stablecoin Settlements

USDC on Stellar for predictable agent costs. No volatility risk for budget enforcement.

getStellarBalances(addr) โ†’ USDC balance

\uD83E\uDE99

Multi-Currency Trust Lines

Agents hold multiple currencies simultaneously via Stellar trust lines โ€” XLM, USDC, EUR tokens.

balances: [XLM: 100, USDC: 50, EUR: 30]

\uD83E\uDDEA

Rapid Prototyping

Free testnet XLM via Friendbot means zero cost to develop and test agent payment flows.

fundStellarTestnet(accountId) โ†’ 10,000 XLM


Architecture

Stellar Integration Flow
Agent Wallet
    โ†“
Aegis Integrations (@aegis-ows/integrations)
    โ†“
Stellar Horizon REST API
    โ”œโ”€โ”€ GET /accounts/{id}        โ†’ Native XLM + trust line balances
    โ”œโ”€โ”€ GET /transactions/{hash}  โ†’ Transaction verification
    โ””โ”€โ”€ GET /friendbot?addr={id}  โ†’ Testnet funding
    โ†“
Stellar Network (Testnet or Pubnet)

All Stellar queries go through the public Horizon API โ€” no API keys required. The SDK handles REST calls, response parsing, and error handling.


Native Payments

Send XLM and USDC between agent wallets via sendStellarPayment(). Near-zero fees (~$0.00001) and 3-5 second finality make Stellar ideal for high-frequency agent-to-agent payments.

Send XLM or USDC
import { sendStellarPayment } from "@aegis-ows/integrations";

// Send XLM
const result = await sendStellarPayment({
  from: "GBZX...",
  to: "GDEST...",
  amount: "10.5",
  asset: "XLM",
  secretKey: process.env.STELLAR_SECRET_KEY,
  testnet: true,
});

// Send USDC on Stellar
const result = await sendStellarPayment({
  from: "GBZX...",
  to: "GDEST...",
  amount: "5.00",
  asset: "USDC",
  assetIssuer: "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
  secretKey: process.env.STELLAR_SECRET_KEY,
  testnet: false,   // mainnet
});

// result.txHash โ€” Stellar transaction hash
// result.ledger  โ€” ledger sequence number
// result.fee     โ€” fee in XLM (tiny!)

~$0.00001 per transaction

Stellar's base fee is 100 stroops (0.00001 XLM). At current XLM prices this is a fraction of a cent โ€” making Stellar the cheapest option for high-volume agent payments.


Account Creation

Stellar accounts require a minimum balance of 1 XLM to exist. sendStellarPayment() automatically handles account creation when sending to a new address by using a createAccount operation instead of a payment operation.

Auto account creation
import { sendStellarPayment } from "@aegis-ows/integrations";

// Sending to a new account? No extra code needed.
// sendStellarPayment detects non-existent accounts and
// uses createAccount operation automatically.
const result = await sendStellarPayment({
  from: "GBZX...",
  to: "GNEWACCOUNT...",   // brand new address
  amount: "2.0",          // must be >= 1 XLM to create account
  asset: "XLM",
  secretKey: process.env.STELLAR_SECRET_KEY,
  testnet: true,
});
// Account created + funded in one transaction

Receipt Anchoring

Stellar transactions support a Memofield (up to 28 bytes). Aegis uses this to embed receipt hashes directly in the payment transaction โ€” zero additional cost.

Payment with receipt memo
import { sendStellarPayment } from "@aegis-ows/integrations";

// Receipt hash is included as memo โ€” no extra transaction needed
const result = await sendStellarPayment({
  from: "GBZX...",
  to: "GDEST...",
  amount: "5.00",
  asset: "USDC",
  assetIssuer: "GA5ZSEJYB37J...",
  memo: "AEGIS_RECEIPT:sha256:abc123",  // embedded in tx memo
  secretKey: process.env.STELLAR_SECRET_KEY,
});

// result.txHash links directly to the payment + proof
// No separate anchoring transaction required
// Verifiable on Stellar Expert: stellarexpert.com

Free receipt anchoring

Unlike Solana (which needs a separate memo transaction), Stellar's Memo field lets you include receipt proof in the same payment transaction โ€” same fee, same hash, one transaction.


Cross-Border Payments

Stellar's built-in DEX and path payments allow agents to send one currency and have the recipient receive another โ€” bridging via XLM automatically. Near-zero fees and 5-second finality make this viable for real-time agent payments.

Path payment (cross-currency)
import { sendStellarPathPayment } from "@aegis-ows/integrations";

// Agent pays in USDC, recipient receives EUR
const result = await sendStellarPathPayment({
  from: "GBZX...",
  to: "GDEST_EU...",
  sendAsset: "USDC",
  receiveAsset: "EUR",
  receiveAmount: "4.50",     // recipient gets exactly 4.50 EUR
  maxSendAmount: "5.10",     // slippage tolerance
  secretKey: process.env.STELLAR_SECRET_KEY,
});
// Stellar DEX finds the best path: USDC โ†’ XLM โ†’ EUR
// Completes in ~5 seconds

5-second finality

Stellar Consensus Protocol settles in a single ledger close โ€” no waiting for block confirmations.

Built-in liquidity

Stellar's on-ledger DEX provides immediate liquidity for XLM โ†” USDC โ†” EUR and other major pairs.


Federation

Stellar Federation resolves human-readable addresses like agent*yourdomain.com to Stellar account IDs. Agents can advertise themselves with a memorable address instead of a raw G... key.

Resolve a federation address
import { resolveStellarFederation } from "@aegis-ows/integrations";

// Resolve agent*domain.com to a Stellar account ID
const address = await resolveStellarFederation("analyst*aegis.xyz");
// "GBZX4CUNMHBZPQQ4PPKWKBUMSFXQ2SHMJJNCFNMSCZMYOQHAFBHZSPQ"

// Use directly in a payment
await sendStellarPayment({
  from: "GBZX...",
  to: await resolveStellarFederation("analyst*aegis.xyz"),
  amount: "1.00",
  asset: "USDC",
  assetIssuer: "GA5ZSEJYB37J...",
  secretKey: process.env.STELLAR_SECRET_KEY,
});

To publish your own federation address, add a stellar.toml file at https://yourdomain.com/.well-known/stellar.toml with a FEDERATION_SERVER entry.


Balance Monitoring

Query XLM + token balances
import { getStellarBalances } from "@aegis-ows/integrations";

// Query balances on testnet (default)
const balances = await getStellarBalances("GBZX...");

// Query balances on mainnet
const mainnetBalances = await getStellarBalances("GBZX...", false);

// Returns:
// [
//   { chain: "Stellar", chainId: "stellar:testnet", token: "XLM",
//     balance: "100.000000", usdValue: "12.00", source: "stellar-horizon" },
//   { chain: "Stellar", chainId: "stellar:testnet", token: "USDC",
//     balance: "50.000000", usdValue: "50.00", source: "stellar-horizon" }
// ]

How it works

  1. Connects to Horizon server (testnet or mainnet)
  2. Calls server.loadAccount() to fetch account data
  3. Iterates account.balances โ€” native XLM + trust line tokens
  4. Returns ChainBalance[] with USD estimates

Transaction Verification

Verify a Stellar transaction
import { verifyStellarTransaction } from "@aegis-ows/integrations";

const result = await verifyStellarTransaction(
  "abc123def456...",  // transaction hash
  true                // testnet (default)
);

// Returns:
// {
//   txHash: "abc123def456...",
//   chain: "stellar:testnet",
//   status: "confirmed",      // "confirmed" | "pending" | "not_found" | "error"
//   blockNumber: 12345,       // ledger sequence number
//   timestamp: "2024-01-15T10:30:00Z",
//   source: "stellar-horizon"
// }

Queries the Horizon /transactions/{hash} endpoint. Returns the ledger sequence number as blockNumber and the creation timestamp.


Testnet Funding

Fund a testnet account
import { fundStellarTestnet } from "@aegis-ows/integrations";

// Fund with 10,000 XLM via Friendbot (free!)
const success = await fundStellarTestnet("GBZX...");

if (success) {
  console.log("Account funded with 10,000 testnet XLM");
}

Zero-cost development

Stellar Friendbot provides free testnet XLM. No faucet limits, no tokens required. Perfect for developing and testing agent payment flows before going to mainnet.


Settlement Verification

Gate-level settlement check
import { verifySettlement } from "@aegis-ows/gate";

const confirmed = await verifySettlement(
  txHash,
  "stellar:testnet"  // or "stellar:pubnet"
);

// true  = confirmed on Stellar
// false = not found
// null  = unable to verify

The gate-level verifySettlement()uses Horizon's transaction endpoint internally. Supports both testnet and pubnet via the network identifier.


Setup Guide

No API keys needed

Stellar Horizon is a public API. All balance queries and transaction verification work without authentication.

Install dependency
npm install @stellar/stellar-sdk
NetworkHorizon Endpoint
Testnethttps://horizon-testnet.stellar.org
Mainnet (Pubnet)https://horizon.stellar.org

Hackathon Ideas

Stellar Community Fund

Cross-border AI agent marketplace with multi-currency settlement via Stellar DEX

Cross-Border Payments

Agents transacting across currencies โ€” pay in EUR, deliver in USD, bridge via XLM

Soroban Smart Contracts

On-chain agent policies enforced via Soroban contracts (future integration)

Financial Inclusion

Micro-payment agents serving unbanked regions via Stellar's low-fee network


API Reference

FunctionParametersReturns
sendStellarPaymentfrom, to, amount, asset, secretKey, memo?, testnet?{ txHash, ledger, fee }
sendStellarPathPaymentfrom, to, sendAsset, receiveAsset, receiveAmount, maxSend, secretKey{ txHash, ledger }
resolveStellarFederationaddress (user*domain.com)string (account ID)
getStellarBalancesaccountId, testnet?ChainBalance[]
verifyStellarTransactiontxHash, testnet?TxVerification
fundStellarTestnetaccountIdboolean