Inspiration

An increasing number of companies worldwide are using bitcoin and other digital assets in their daily operation and transaction. As of 2022, more than 15-thousand businesses accept crypto payments. Compared with credit card payments, crypto payments have faster settlement cycles and can be cheaper due to lower transaction costs. However, the nature of price volatility makes the crypto payment hard to settle with an agreed value to the merchants. Thus, merchants in the paycheck domain, e-commerce, apar, etc., still expect to settle transactions in fiat-equivalent currencies. Also, online merchants accepting crypto want to avoid extra overheads setting up and operating the addresses on one or more chains.

What it does

It accepts customer payments in stablecoins like USDC on various chains. The merchant users of this product can choose their money to be settled either on a preferred chain or even entirely off-chain.

How we built it

We started with investigating existing crypto payment products like Coinbase commerce. Then we came up with our own product and system designs which includes a merchant panel, a client payment view, a smart contract for splitting payments, and an off-chain service.

We then started building the product. Since we do not have frontend experts on the team, we found 2 open sourced frontend code bases and customized them for the merchant panel (Armour: https://github.com/armour/vue-typescript-admin-template), and client payment view (hop: https://github.com/hop-protocol/hop). During the implementation, we then noticed we need an on-chain node to connect with our backed service for real-time transaction status updating. We then created an Alchemy node.

Challenges we ran into

  • Learning Ethers.js interact with Metamask APIs
  • Encounter rate-limiting on public polygon RPC service
  • How to properly retrieve gas fee estimation by interacting with the Polygon network

Accomplishments that we're proud of

  • A seamless payment experience with USDC by using a web3 wallet (Metamask)
  • A smart contract on Polygon that splits payments into merchant payouts and transaction fees to the service
  • Real-time payment status updates to our merchants.

What we learned

  • Implementing smart contract with Solidity
  • Interacting with smart contracts using Ethers.js
  • Connecting with on-chain nodes using web3java
  • Using Polygon network

What's next for 0xPayment

  • Cross-chain payment support
  • More stablecoins support
  • Offline payout support

Built With

Share this project:

Updates