The Masumi Payment Service provides an easy-to-use service to handle decentralized payments for AI agents. It supports a RESTful API and includes functionalities such as wallet generation, payment verification, and automated transaction handling.
Masumi is a decentralized protocol designed to enable AI agents to collaborate and monetize their services efficiently. If you are developing an agentic service using frameworks like CrewAI, AutoGen, PhiData, LangGraph, or others, Masumi is built for you.
- Identity Management: Establish trust and transparency by assigning an identity to your AI service.
- Decision Logging: Securely log agent outputs on the blockchain to ensure accountability.
- Payments: Facilitate agent-to-agent transactions and revenue generation.
Learn more about Masumi in our Introduction Guide.
Refer to the official Masumi Docs Website for comprehensive documentation.
Additional guides can be found in the docs folder:
Ensure your system meets the following requirements before installation:
- Node.js v20.x or later
- PostgreSQL 15 database
The node consists of two different repositories. We start with the Payment Service, which is key to getting started. The Registry Service is not required and is optional to run.
We are focusing on setting everything up for the Preprod Environment of Masumi. This is the environment you should start with to get familiar with Masumi and to connect and test your agentic services before you switch to the Mainnet environment.
git clone https://github.com/masumi-network/masumi-payment-service
cd masumi-payment-service/
npm install
git fetch --tags
git checkout $(git tag -l | sort -V | tail -n 1)
Copy the .env.example
file to .env
and update the following variables:
DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/masumi_payment?schema=public"
ENCRYPTION_KEY="abcdef_this_should_be_very_secure_and_32_characters_long"
ADMIN_KEY="abcdef_this_should_be_very_secure"
BLOCKFROST_API_KEY_PREPROD="your_blockfrost_api_key"
*optionally for mainnet add or replace BLOCKFROST_API_KEY_PREPROD
BLOCKFROST_API_KEY_MAINNET="your_blockfrost_api_key_for_mainnet"
if you want to run on mainnet. We recommend you to start on Preprod first.
If you don't know how to set up a PostgreSQL database - learn more below.
Get a free Blockfrost API Key from blockfrost.io - learn more below.
Set the Encryption and Admin Keys yourself.
npm run prisma:migrate
npm run prisma:seed
docker compose up -d
Congratulations! You have successfully run the Masumi Payment Service in Docker.
cd frontend
npm install
npm run build
cd ..
Start the node with:
npm run build && npm start
Access the following (localhost) interfaces:
With this setup, you have done the bare minimum to get started!
Make yourself familiar with the Wallets Chapter next, in order to secure your wallets. This is especially important as soon as you want to switch to Mainnet.
As long as you are on Preprod, there is nothing to worry about!
Blockfrost is an API Service that allows the Masumi node to interact with the Cardano blockchain without running a full Cardano Node ourselves. It is free and easy to get:
- Sign up on blockfrost.io
- Click "Add Project"
- Make sure to choose "Cardano Preprod" as Network
- Copy and Paste the API Key
Blockfrost is free for one project and for 50,000 Requests a Day, which is sufficient to run the node 24 hours. Should you switch to Mainnet, you will need to change your project.
If PostgreSQL is not installed, follow these steps (for MacOS):
brew install postgresql@15
brew services start postgresql@15
To create a database:
psql postgres
create database masumi_payment;
\q
Ensure that your DATABASE_URL
matches the configured database settings.
In principle, you can follow the same process to install the Masumi Registry Service. It will require a separate database and another adjustment of the .env
file.
However, you can also register your agents through the Masumi Explorer or directly use our centrally provided registry service to get started: http://registry.masumi.network.
We welcome contributions! Refer to our Contributing Guide for more details.
This project is licensed under the MIT License.