Inspiration
Stablecoins and crypto assets are powerful, but everyday merchants should not need to become wallet operators, traders, or blockchain engineers to accept them.
Merchants think in local currencies such as IDR or USD. Customers may hold ETH, USDC, USDT, or other assets. We built Mayarin to connect these two worlds:
Merchants price in fiat. Customers pay with supported crypto. Merchants settle in stablecoins.
The name Mayarin is inspired by the Indonesian word bayar, meaning "to pay," representing a global payment layer designed from an emerging-market perspective.
Problem We're Solving
Here's the problem we're solving.
Imagine a merchant from Indonesia or other countries wants to sell to customers around the world.
The merchant still thinks in rupiah or local currency. Their products are priced in rupiah, their accounting runs in rupiah, and ultimately, they want to receive money in the currency or stablecoin they choose.
But their customers shouldn't have to think about that.
A customer in another country might already hold USDC, ETH, or another digital asset. They want to pay with what they already have, without opening an Indonesian bank account, dealing with local payment methods, or relying on a local marketplace just to complete the transaction.
Today, connecting those two sides is unnecessarily complicated.
If the merchant wants to accept crypto directly, suddenly they have to understand wallets, networks, gas fees, confirmations, exchange rates, liquidity, settlement, and price volatility.
That's infrastructure complexity the merchant should never have to manage.
Mayarin sits in the middle.
The merchant defines what they want to receive. The customer chooses what they want to pay with.
Mayarin handles everything in between — quoting, conversion, execution, and settlement.
So instead of merchants becoming blockchain experts just to accept global payments, they integrate one clearing layer and keep focusing on their business.
What It Does
Mayarin is programmable crypto-commerce infrastructure.
It allows a merchant to:
- Create payment intents in local fiat currency.
- Choose a stablecoin settlement asset.
- Accept supported crypto assets from customers.
- Generate hosted checkout pages, payment links, QR codes, or API-based payment requests.
- Automatically quote and lock the merchant's settlement amount.
- Convert the customer's asset on-chain when necessary.
- Receive settlement directly into a merchant-controlled wallet.
- Track payment state, settlement, fees, and reconciliation through APIs and a dashboard.
Mayarin supports two payment paths:
- A connected-wallet path using an on-chain PaymentRouter.
- A deposit path using a unique address per payment, supporting exchange withdrawals and ordinary wallet transfers.
The system records every movement through an idempotent, resumable, double-entry ledger.
How We Built It
We built Mayarin as a modular TypeScript and Bun monorepo with a Hono API, PostgreSQL, Drizzle ORM, and provider-agnostic domain packages.
The main components are:
- Payment Intent and immutable payment lifecycle.
- Clearing Engine with idempotent, resumable state transitions.
- Exact money handling using BigInt minor units.
- Stablecoin Registry for supported settlement and payer assets.
- Liquidity Router and pluggable price sources.
- Quote Engine with oracle validation, slippage bounds, TTLs, and EIP-712 orders.
- PaymentRouter smart contract for atomic receive, swap, and settlement.
- Chain watcher and settlement indexer with confirmation and reorg policies.
- Double-entry ledger derived from payment and on-chain events.
- Merchant wallet infrastructure using Safe smart accounts and Turnkey policy controls.
- REST API, TypeScript SDK, hosted checkout, dashboard, embeddable checkout, and WooCommerce integration.
The on-chain execution path is designed so the backend orchestrates the payment but does not directly hold or move customer funds. The contract performs the critical receive, swap, and settlement operation atomically.
Challenges We Ran Into
The hardest challenge was supporting multiple payment behaviors without creating separate payment systems.
A customer connecting a wallet can submit smart-contract calldata, but a customer withdrawing from an exchange can usually only send a plain transfer. We solved this with two execution paths that share the same payment intent, clearing engine, ledger, and settlement model.
Other challenges included:
- Mapping ordinary blockchain transfers to the correct payment without memos or calldata.
- Handling blockchain confirmations, reorgs, orphaned deposits, and indexing delays.
- Preventing quote drift between fiat pricing, payer amounts, and settlement amounts.
- Avoiding floating-point errors across IDR, stablecoins, ETH, and 18-decimal assets.
- Designing atomic execution without turning Mayarin into a custodial FX treasury.
- Making merchant wallets self-custodial from the first payment.
- Protecting quote-signing keys and separating them from merchant wallet custody.
- Making retries safe so crashes do not duplicate ledger postings or payments.
- Keeping compliance and reconciliation based on existing immutable records instead of creating another source of truth.
Accomplishments That We're Proud Of
We are proud that Mayarin is more than a checkout screen. It provides a complete payment infrastructure foundation.
Our key accomplishments include:
- A working programmable clearing engine.
- Atomic on-chain receive, swap, and merchant settlement.
- PaymentRouter deployed and verified on Base Sepolia.
- Support for both wallet-based payments and ordinary deposit transfers.
- CREATE2 deposit forwarders for gas-paid treasury execution.
- Per-intent deposit addresses derived from a watch-only public key.
- Reorg-aware chain watchers and settlement indexing.
- Exact, asset-aware money calculations without floating point.
- A balanced double-entry ledger for payment, settlement, fees, FX results, and gas.
- Merchant-controlled Safe wallets with passkey and managed-wallet paths.
- Provider-agnostic interfaces for chains, liquidity, wallets, settlement, and screening.
- A complete developer surface through APIs, SDKs, webhooks, checkout, dashboard, and plugins.
- A documented custody boundary and explicit threat model.
Most importantly, we proved that a merchant can price in fiat while a customer pays with a different crypto asset, with the merchant receiving a predictable stablecoin settlement.
What We Learned
We learned that crypto payments are not only a transaction-submission problem. The difficult parts are the boundaries between pricing, execution, custody, accounting, and user experience.
We learned that:
- Atomicity is essential when promising a merchant a minimum settlement amount.
- A backend should orchestrate value movement without becoming the custodian of that value.
- A payment state machine must be idempotent, resumable, and auditable from the beginning.
- The chain should be treated as the source of truth for on-chain settlement, while the ledger acts as a reconciled projection.
- "Self-custodial" must be enforced through signer ownership, recovery, and policy — not only described in marketing language.
- Stablecoin settlement provides predictable units, but does not remove stablecoin issuer or depeg risk.
- QR payments and connected-wallet payments are fundamentally different user journeys.
- Precision, rounding, expiration, and underpayment behavior are product concerns as much as engineering concerns.
- Provider abstraction is valuable only when the domain model remains independent from providers.
- AI payment flows will require strong authorization, spending limits, approval policies, and auditability before agents can safely move funds.
What's Next for Mayarin
Our next focus is turning the infrastructure into a broader commerce platform.
We plan to expand:
- Production merchant onboarding and hosted checkout.
- Fee splitting, refunds, and merchant withdrawals.
- Gas abstraction for managed merchant wallets.
- More payer assets, liquidity venues, and blockchain networks.
- Configurable settlement assets per merchant.
- Stronger compliance, reporting, reconciliation, and operational tooling.
- High availability, event streaming, and multi-region infrastructure.
- Provider and plugin SDKs for third-party integrations.
We also see a future for AI-native commerce.
Mayarin could provide an Agent Pay or MCP-compatible payment layer where an AI assistant can:
- Discover supported payment options.
- Request a quote.
- Create a payment intent.
- Ask for user approval.
- Submit or link to a payment.
- Monitor settlement.
- Return a verifiable payment receipt.
Agents would not receive unrestricted wallet access. Any future AI integration would require scoped identities, spending limits, approved assets and merchants, human approval thresholds, idempotency, expiration, revocation, and a complete audit trail.
Our long-term goal is simple:
One integration for developers, predictable stablecoin settlement for merchants, and flexible payment choice for customers.
Built With
- 0x
- alchemyapi
- base
- bun
- chainlink
- drizzle
- evm
- hono
- polygon
- postgresql
- pyth
- react
- rpc
- safe-wallet
- smart-contract
- solidity
- tempo
- turnkey
- typescript
- uniswap
- viem
Log in or sign up for Devpost to join the conversation.