SWORD

1. Borderless Money 🌍 Making global payments simple for everyone.

SWORD

Created At

ETHGlobal Mumbai

Project Description

The problem

Imagine a freelancer who gets paid in stablecoins by a client abroad. The money is theirs, but they still can't use it to buy groceries or pay rent. Local rules often stop them from converting it directly. The usual workarounds don't last. Peer-to-peer traders often get their bank accounts frozen, and crypto cards are being closed one by one. Many governments don't regulate stablecoins yet, even though millions of people already use them. Sending money across borders is also expensive. Banks and payment apps add heavy fees, currency markups and transfer charges.

Why we built Sword

Sword is an onchain neo bank. Anyone can collect a payment in stablecoins, and the person receiving it can turn that money into their local currency at the lowest fees we can offer, about 1%. How it works

Sword works with a US bank partner. When someone wants to cash out, the stablecoins are redeemed into US dollars in a virtual account held at that partner bank. From there, the money is sent to the person's own local bank account in their own currency, through major banks. The local bank only ever receives regular money, so it never handles crypto directly.

How merchants use Sword

  1. The merchant signs up, chooses its country and currency, and gets a Sword account.
  2. It registers once, which creates its own order book where all its orders are recorded.
  3. It creates an order with an amount and a reference. The order gets a unique address to pay to, plus a QR code and a pay link.
  4. The customer pays in stable coins from a wallet or Sword account, or by bank transfer in their own currency.
  5. Once the payment is confirmed on chain, the order is marked paid. The merchant can see it in its orders, notifications and activity.
  6. The merchant withdraws the money, or cashes it out to its local bank account. It can also refund all or part of a payment.
  7. For recurring payments, the merchant creates a subscription with its own deposit vault. Each period is charged when due.

How customers use Sword

  1. The customer signs in with Google, and a Sword account is created for them.
  2. They pay merchants by scanning a QR code or opening a pay link, using stablecoins or a bank transfer in their own currency.
  3. They can see every payment in Purchases and Activity, and ask for a refund when needed.
  4. They manage subscriptions, including cancelling at any time.
  5. They can cash out their balance to their local bank account, at today's exchange rate.

For developers: the SDKs

Sword gives developers two open-source packages, so they can build payments into their own apps without writing blockchain code.

-sword-merchant is for a merchant's backend. It uses an API key, so the server never needs a private key. A developer can create an order, send the customer to its checkout link, and confirm payment:

import { Sword } from "sword-merchant";

const sword = new Sword({ apiKey: process.env.SWORD_API_KEY });
const order = await sword.orders.create({ amount: "25.00", reference: "invoice-1042" });
// send order.checkoutUrl to the customer, then wait for payment
const paid = await sword.orders.waitForPayment(order.id);

It also covers refunds, withdrawals, and subscriptions: create, charge when due, refund, and cancel.

sword-sdk is the lower-level package for apps that work directly with the contracts. It covers accounts, merchant order books, permissions (a spending limit the owner signs once and can revoke), orders, payments and subscriptions. Wallet owners use it to sign what they approve, and merchants use it to run their own transactions.

Both packages are published on npm, and the source is in the SWORD repo.

How it's Made

Sword is three pieces that talk to each other: smart contracts on the blockchain, a server, and a website. Developers can also use two SDKs.

Contracts: written in Solidity and built and deployed with Hardhat on Node.js. A deploy script records each contract's address in a file the rest of the project reads. Core contracts include an order book per merchant, account and permission contracts, subscription vaults, a factory, a registry, and a spender for approved payouts. SDKs: TypeScript on viem, a library for talking to the blockchain. sword-sdk covers the contracts directly. sword-merchant wraps the API with an API key, so merchant servers never hold a private key. Both are published on npm. API server: Hono on Node.js, with a Postgres database on Neon. One server handles every supported network. Each API key belongs to one merchant on one network, so each call uses that network's RPC endpoint and token. Website: Next.js 16 with React and Tailwind. The landing page's 3D coins are made with react-three-fiber. Sign-in is Google. Wallets connect through MetaMask. Relayer: a server wallet pays gas for custodial accounts and for wallets that signed a permission, so customers don't need the native coin for everyday actions. Hacky parts worth knowing

Wallet extensions and browser shields block some RPC calls, which broke payments. The website now proxies read-only calls through its own /api/rpc route. Wallets still get the real endpoint. The 3D coin symbols are glyph outlines extracted fro m a font with a one-off script and stored as code, so the page downloads no font file. https://ethglobal.com/events/mumbai/project

background image mobile

Join the mailing list

Get the latest news and updates

SWORD | ETHGlobal