Alkahest is a library and ecosystem for peer-to-peer exchange.
Statements represent obligations within a peer-to-peer agreement, while validators represent conditions under which statements are considered valid.
These compose with each other to eventually enable trading anything for anything else, with flexible per-deal assurance guarantees.
Learn more at Alkahest Docs.
This is a monorepo containing the Alkahest smart contracts and SDKs for multiple languages:
alkahest/
├── contracts/ # Solidity smart contracts and Foundry tooling
│ ├── src/ # Contract source code
│ ├── test/ # Contract tests
│ ├── script/ # Deployment scripts
│ └── lib/ # Dependencies (forge-std, EAS, OpenZeppelin)
├── sdks/ # Language-specific SDKs
│ ├── py/ # Python SDK
│ ├── rs/ # Rust SDK
│ └── ts/ # TypeScript SDK
└── docs/ # Documentation
The contracts are built with Foundry.
cd contracts
forge build
forge testSee contracts/README.md for more details.
Each SDK has its own setup and usage instructions:
- Python: See sdks/py/README.md
- Rust: See sdks/rs/README.md
- TypeScript: See sdks/ts/README.md
Comprehensive guides and tutorials are available in the docs/ directory:
- Escrow Flow (pt 1 - Token Trading) - Learn how to trade tokens using escrow
- Escrow Flow (pt 2 - Job Trading) - Trade computational work for tokens
- Escrow Flow (pt 3 - Composing Demands) - Combine multiple obligations
- Writing Arbiters (pt 1 - On-chain Arbiters) - Create on-chain validation logic
- Writing Arbiters (pt 2 - Off-chain Oracles) - Build off-chain oracles (Python, Rust, TypeScript variants)
- Writing Escrow Contracts - Create custom escrow obligations
- Writing Fulfillment Contracts - Create custom payment obligations
- Foundry
- Node.js (for TypeScript SDK and scripts)
- Python 3.10+ (for Python SDK)
- Rust (for Rust SDK)
# Build contracts
cd contracts && forge build
# Build TypeScript SDK
cd sdks/ts && npm install && npm run build
# Build Python SDK
cd sdks/py && pip install -e .
# Build Rust SDK
cd sdks/rs && cargo buildContributions are welcome! Please check the individual README files in each directory for specific contribution guidelines.
MIT
