Skip to content

Repository files navigation

Pactum

An on-chain registry for recurring commitments — and a public, verifiable record of who keeps their word.

Pactum lets any two parties register a real-world commitment on Stellar — a refund promise, an uptime guarantee, a milestone check-in, a recurring report — and tracks whether it was fulfilled on time, late, or broken. Every commitment becomes part of a public, queryable compliance history for the addresses involved.

Soroban Network License CI


The problem

Escrow contracts handle one-time deals — money goes in, money comes out once conditions are met. But a lot of real commitments aren't one-time payments at all:

  • A landlord promising to return a deposit within 30 days of move-out
  • An API provider guaranteeing 99.9% uptime this quarter
  • A freelancer committing to weekly milestone updates
  • A DAO grantee promising monthly progress reports

There's currently no simple, general-purpose way to record these kinds of ongoing promises on-chain, or to see — trustlessly — whether someone has a track record of actually keeping them.

What Pactum does

Pactum is a lightweight registry, not a payment or custody system. It doesn't hold funds. It records who promised what to whom, by when — and whether they delivered.

 create_commitment(issuer, counterparty, terms, due_at)
              │
              ▼
     ┌──────────────────┐
     │  Registry          │   on-chain source of truth
     │  Contract          │   (Soroban, Rust)
     └────────┬──────────┘
              │ events
              ▼
     ┌──────────────────┐
     │  Indexer            │   watches events, aggregates
     │  (backend)           │   per-address compliance history
     └────────┬──────────┘
              │
              ▼
     ┌──────────────────┐
     │  REST API            │   GET /reputation/GABC...
     │  + JS SDK             │   → { fulfilled: 14, late: 2, breached: 1 }
     └──────────────────┘
  1. Create — either party (or both) registers a commitment: what's promised, to whom, and the due date.
  2. Attest — when the due date arrives, the commitment is marked fulfilled, either by mutual confirmation, a designated oracle, or the counterparty's sign-off.
  3. Dispute — if the parties disagree on whether it was met, the commitment is flagged as disputed rather than silently resolved either way.
  4. Aggregate — the backend indexes every commitment's outcome into a per-address compliance history — a real record built from timestamped, on-chain events instead of subjective star ratings.

Project structure

pactum/
├── contracts/registry/     # Soroban smart contract (Rust)
├── backend/                # REST API + on-chain event indexer (TypeScript)
├── sdk/js/                 # Lightweight JS/TS SDK for dApp integration
├── docs/                   # Architecture, contract & API reference, integration guide
└── examples/                # Minimal integration demo

See docs/architecture.md for the full breakdown.


Tech stack

Layer Technology
Smart contract Rust + Soroban SDK
Contract network Stellar Testnet
Backend API Node.js + TypeScript + Express
Indexer Soroban RPC event listener
Database PostgreSQL
SDK TypeScript, published as @pactum/sdk
Testing Cargo test (contract) · Jest (backend)
CI/CD GitHub Actions

Contract interface (early draft)

Method Kind Description
create_commitment(issuer, counterparty, terms_hash, due_at) write Register a new commitment between two addresses
attest(commitment_id, outcome) write Mark a commitment fulfilled, late, or breached
dispute(commitment_id, reason) write Flag a commitment as contested rather than resolved
resolve_dispute(commitment_id, outcome) write Designated arbitrator/oracle settles a disputed commitment
get_commitment(commitment_id) read Fetch a single commitment's details and status
get_reputation(address) read Aggregate fulfilled / late / breached counts for an address

Full spec lives in docs/contract-reference.md as the contract develops.

Production Deployment

The contract is currently deployed on the Stellar Testnet for testing and integration.

Contract Network Contract ID Explorer
Registry Testnet CBADTVTJ6IN332HIKZ7LWUYMYTLPZYCEBV3X2HS47VHR5UDBHQ3GAA7E Stellar Expert

Example Transactions


Getting started (local dev)

Prerequisites: Rust + Cargo, soroban-cli, Node.js 18+, PostgreSQL

# 1. Clone
git clone https://github.com/<your-username>/pactum.git
cd pactum

# 2. Build & test the contract
cd contracts && cargo test

# 3. Set up the backend
cd ../backend
npm install
cp .env.example .env      # fill in DATABASE_URL, SOROBAN_RPC_URL, etc.
npm run migrate:latest
npm run dev

Roadmap

  • Core registry contract — create / attest / dispute / resolve
  • Per-address reputation aggregation
  • Oracle-based auto-attestation for measurable commitments (e.g. uptime feeds)
  • Commitment templates (refund, SLA, recurring report, milestone check-in)
  • Public reputation lookup API
  • JS/TS SDK (@pactum/sdk)
  • Marketplace integration example (check a counterparty's history before a deal)
  • Rate limiting & spam-commitment protections
  • Dashboard endpoint (commitments created/fulfilled over time)

Open an issue if you'd like to pick up any of these — contributions welcome.


Contributing

See CONTRIBUTING.md for local setup, coding conventions, and how to submit a pull request.

Security

Found a vulnerability? Please see SECURITY.md for responsible disclosure.

License

MIT — see LICENSE.

About

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages