Skip to content
@stellar-sharpy

sharpy

Sharpy is an on-chain split payment protocol on Stellar Soroban. Create invoices with recurring splits, escrow protection, and batch operations.

Sharpy — Advanced Split Payment Protocol on Stellar

Sharpy is a payment splitting protocol built on Stellar Soroban. It enables creators to issue on-chain invoices that automatically distribute funds to multiple recipients according to configurable rules — with recurring schedules, escrow protection, agentic payment support, and a full TypeScript SDK.

image

Live

Pitch DeckView on Gamma
dAppsharpy-sigma.vercel.app
Testnet ContractCCMN5OYWBWVVRIB3IDE2CCODM3CMGSMYQ7EV2UVBJ23DVIH2CL6FJRXP
Mainnet ContractComing soon
npm@stellar-sharpy/sdk

Live Testnet Transactions

See Sharpy in action with real on-chain transactions:

Test Account: GD4Q2BH6...RS63


Repositories

RepoDescriptionLanguageStatus
sharpy-contractsCore Soroban smart contractRust✅ Testnet live
sharpy-sdkTypeScript SDKTypeScript✅ Published
sharpy-appNext.js 14 frontend dAppTypeScript✅ Vercel live

Architecture

graph TD
User["User / Browser"]
Agent["AI Agent / HTTP Client"]
Freighter["Freighter Wallet"]
App["sharpy-app\nNext.js 14 · Vercel"]
SDK["@stellar-sharpy/sdk\nTypeScript SDK"]
X402["x402 Protocol\nHTTP 402 Payments"]
RPC["Soroban RPC\nstellar-sdk 16.0.1"]
Contract["Sharpy Contract\nSoroban · Protocol 27"]
Stellar["Stellar Network"]
Horizon["Horizon API"]
User -->|"connects wallet"| Freighter
User -->|"interacts"| App
Agent -->|"GET /api/x402/[id]"| X402
App -->|"calls methods"| SDK
X402 -->|"settles payment"| SDK
Freighter -->|"signs auth entry"| SDK
SDK -->|"simulate + submit"| RPC
RPC -->|"executes"| Contract
Contract -->|"state + events"| Stellar
Stellar -->|"event polling"| Horizon
Horizon -->|"invoice history"| App
Loading

Features

Invoice Management

  • Multi-recipient invoices — split funds to any number of recipients in one transaction
  • Batch creation — create up to 10 invoices in a single transaction
  • Recurring/subscription invoices — auto-generate the next invoice on release
  • Cancel & refund — creator can cancel and refund all payers at any time

Payment & Settlement

  • Pay — single payment toward an invoice
  • Pool pay — pay multiple invoices in one call
  • Multi-token support — USDC, XLM, AQUA, yXLM per recipient
  • x402 agentic payments — AI agents and HTTP clients pay invoices via the HTTP 402 protocol

Split Rules

TypeBehaviour
Fixed(amount)Pay exact amount regardless of funded total
Percentage(bps)Pay funded * bps / 10_000 (validated ≤ 100%)
Tiered(threshold, bps)Pay percentage only if funded > threshold

Escrow & Security

  • Escrow protection — hold funds with configurable release delay
  • Escrow dispute mechanism — optional arbitrator can intervene before release
  • Audit log — full on-chain audit trail per invoice
  • Admin circuit breaker — pause/unpause contract

Protocol 25/26 Features

CAPProtocolFeature
CAP-8226Checked arithmetic in all split calculations — overflow-safe
CAP-7826bump_invoice_ttl — prevent archival of long-lived invoices
CAP-7525get_invoice_fingerprint — SHA-256 tamper-evident content hash

Frontend

  • Public shareable /pay/[id] page — no login required to view
  • Dashboard with search and filter
  • QR code for invoice payment links
  • Copy-to-clipboard for invoice URLs
  • Transaction confirmation step indicators
  • Dark/light mode with system preference detection
  • Public on-chain verification page (/verify/[id]) with fingerprint display

Quick Start

Install SDK

npm install @stellar-sharpy/sdk

Create and pay an invoice

import{SharpyClient,connectWallet,parseAmount,deadlineFromDays,NETWORKS}from"@stellar-sharpy/sdk";// Connect Freighter walletconstpublicKey=awaitconnectWallet();// Initialize client (testnet pre-configured)constclient=newSharpyClient(NETWORKS.testnet);// Create a split invoice — 60/40 between two recipientsconst{ invoiceId }=awaitclient.createInvoice({creator: publicKey,recipients: [{address: "GABC...RECIPIENT1",amount: parseAmount("60")},{address: "GDEF...RECIPIENT2",amount: parseAmount("40")},],token: NETWORKS.testnet.contractId,deadline: deadlineFromDays(7),});// Pay the invoiceawaitclient.pay(publicKey,invoiceId,parseAmount("100"));// Check statusconstinvoice=awaitclient.getInvoice(invoiceId);console.log(invoice.status);// "Released"

x402 Agentic Payment (AI agents / HTTP clients)

# Any HTTP client or AI agent can pay an invoice:
curl -i https://sharpy-sigma.vercel.app/api/x402/1
# → 402 Payment Required with payment requirements# After signing auth entry:
curl -X POST https://sharpy-sigma.vercel.app/api/x402/1 \
-H "X-Payment: <signed-payload>"# → 200 OK with receipt

Contract Functions

FunctionDescription
initialize(admin, treasury)Set admin and treasury addresses
create_invoice(...)Create invoice with split rules and escrow options
create_batch(...)Create up to 10 invoices in one transaction
create_recurring(...)Create recurring invoice with auto-generation
pay(payer, invoice_id, amount)Pay toward an invoice
pool_pay(payer, payments)Pay multiple invoices in one call
release_escrow(invoice_id)Release after escrow delay passes
release(invoice_id)Manual release for fully funded invoice
refund(invoice_id)Refund payers after deadline
cancel_invoice(caller, invoice_id)Creator cancels and refunds
get_invoice(id)Read full invoice state
get_invoice_stats(id)Funded/total/completion_bps/unique_payers
get_invoice_fingerprint(id)SHA-256 tamper-evident content hash
get_audit_log(id)Full audit trail
get_payer_total(id, payer)Total paid by a specific address
get_next_recurring(id)Next invoice in recurring chain
bump_invoice_ttl(id)Extend invoice storage TTL (Protocol 26 CAP-78)
dispute_release(invoice_id)Raise escrow dispute
resolve_dispute(invoice_id, release)Arbitrator resolves dispute
pause / unpauseAdmin circuit breaker

Protocol Compatibility

soroban-sdkstellar-sdkProtocolNotes
26.1.016.0.127 ✅Current — CAP-71 auth delegation ready

Contributing

We welcome contributions across all three repositories. See each repo's CONTRIBUTING.md for setup instructions.

Please read our Code of Conduct before contributing.


Security

To report a vulnerability, please use the GitHub Security Advisory — do not open a public issue.


License

MIT License — see LICENSE


Built on Stellar · Protocol 27 · Soroban

Pinned Loading

  1. sharpy-appsharpy-appPublic

    Next.js 14 dApp for Sharpy — on-chain split payments with recurring invoices and escrow on Stellar

    TypeScript 5

  2. sharpy-contractssharpy-contractsPublic

    Soroban smart contract for advanced split payments on Stellar — recurring invoices, escrow, and batch operations

    Rust 3

  3. sharpy-sdksharpy-sdkPublic

    TypeScript SDK for the Sharpy split payment protocol on Stellar Soroban

    TypeScript 2

Repositories

Showing 4 of 4 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…