Last year, in a groundbreaking move, PayPal announced the launch of its US dollar-denominated stablecoin, PayPal USD ($PYUSD). While many may have overlooked it as “just another stablecoin” – we saw something different.
As former longtime PayPal’ers, active contributors in the crypto ecosystem, and total payment nerds, we immediately saw the potential that could be unlocked with an ERC20 backed by PayPal’s global network. To us, this was about access:
With PYUSD, any ERC20 token-holder could easily swap into an open-loop PayPal balance – seamlessly offramping into PayPal’s formerly walled garden.
From there, they could do all of the things that the payment giant offered, like paying a friend back on Venmo, or buying something online.
In this new design space – onchain activity blends more seamlessly into “real-life” transactions, and permissionless frontiers overlap more concretely with proven trust and scale.
That led us (Amanda / Garden Labs and Brent / Mono Koto) to start tinkering, which led to the creation of pyusd.to – an open-source, proof-of-concept dApp that allows web3 users to easily swap from any asset into PYUSD, sending funds directly to PayPal and Venmo accounts in a few clicks.
We’ll tell you more below, or you can jump into our docs and repo here:
We built PYUSD.to to demonstrate the emerging overlap between digital assets and traditional financial systems. The dApp essentially has two key functionalities: streamlined swaps and transfers, and a simplified method for sharing PYUSD receiving addresses.
Using Uniswap, PYUSD.to streamlines the conversion of any ERC20 token into PYUSD. This process allows users to easily transfer funds to an Ethereum wallet (using ENS names or direct wallet addresses) or straight into a PayPal account.
PYUSD.to also introduces a feature for PayPal and Venmo users to generate custom links for sharing their PYUSD receiving addresses. This simplifies receiving Ethereum network payments by bypassing the need for complicated wallet address exchanges.
This combination of features not only positions PYUSD.to as an efficient crypto off-ramp and a connector between cryptocurrencies and conventional payment platforms, but also opens the door to a range of future opportunities and integrations (more on that below).
To start, a user can enter a recipient wallet address. This can be an ETH wallet address, an ENS domain, or the ETH address associated with their PayPal or Venmo account (aka a PYUSD receiving address). Note: inputting the latter allows for offramping into a PayPal / Venmo wallet, but takes some digging; help docs are available.
The user is then directed to a dedicated recipient page (note: the persistent URL created defaults to the wallet address / ENS input).
On this page, there is an opportunity to personalize this URL, which is a helpful step for PayPal / Venmo users who have uncovered their PYUSD receiving address and prefer to share a simplified alias going forward. Additional sharing functionality, like the ability to generate a QR code, is also available for receiving payments in-person.
From here, users can select the asset they wish to send (from the list of all tokens supported on Uniswap) and the desired amount.
After connecting their wallet and confirming their transaction – zip zap boom: a user’s token is swapped into PYUSD and settled into the recipient wallet. If the recipient wallet is a PYUSD receiving address, tokens settle as PYUSD into PayPal or Venmo.
Like most modern dApps, we were able to move fast by building on some great libraries.
The stack we used to build the app: Typescript, NextJS, Vercel, TailwindCSS, Viem, Wagmi, RainbowKit, Kysely, PostgreSql, ShadCN + Radix, React Icons, P5.js, and much more.
We originally began as a standalone front-end dApp, but we migrated to a NextJS fullstack app in order to support persistence for personalized URLs.
To support ENS addresses we utilized Wagmi’s ENS query hooks, which we wrapped into our own generalized useEns hook. We also wrote an ENSAvatar component that optionally pulls in the ENS avatar, if set on the record. If not, we fall back to a lovely BoringAvatar.
Once a user submits a transaction, we use the Uniswap AlphaRouter to find the optimal swap path from the selected asset into PYUSD. While Uniswap’s frontend hits a dedicated routing endpoint with caching and other performance optimizations (which uses AlphaRouter under the hood), we kept the routing on the client by tweaking configurating to limit swaps and splits. This config still covers the vast majority of possible tokens a user may want to swap.
Once we have the route, we can use Wagmi’s transaction hooks to prepare/execute:
For the curious builders, we have a few other fun tidbits in the codebase, including:
A P5.js dynamic background that updates for every token pair
Config options to set different preferred tokens, or even a different target token.
Easy-access hooks for creating an Ethers provider and generating an anon Ethers signer from a Viem client.
A few other little hooks for things like block explorer URLs and grabbing allowances.
The ability to interact with PayPal accounts so easily and seamlessly is what really opened our eyes to the future possibilities with PYUSD.
The potential for streamlined interactions between public blockchains and private financial systems opens the door to a range of opportunities for both businesses and individuals. There are a number of emerging areas that we believe will compose well with PYUSD.to and $PYUSD generally
Smart contract wallets
Account abstraction and smart contract wallets will enable PayPal users to stand up and fund new wallets protected via social login. We could even use Log In with PayPal allowing every PayPal user to leverage PayPal to secure their wallet.
Paymasters
Related, a PYUSD paymaster could let app builders offer PayPal and Venmo users the ability to pay for all their onchain transactions using PYUSD. Funding with native ETH will no longer be necessary.
Personalized addresses
The history of PayPal’s paypal.me integration inspired us to play with ENS integrations. We imagined the ease and familiarity of paypal.me, empowered by the permissionless nature of a blockchain network.
Offchain ENS resolution could let the kinds of personalized URLs we played with become usable as real ETH addresses, e.g. pyusd.to/amanda -> amanda.pyusd.to
We’re looking forward to an even more widely integrated system where we envision linked ENS addresses in subdomains managed within a user’s distinct PayPal wallet account.
Casual commerce
While business capabilities aren’t yet available for PYUSD, it’s already a great option for small casual transactions today. In the past, many entrepreneurs got their start as just individuals accepting Venmo or PayPal for one-off payments. Now imagine using crypto to pay a farmers market vendor or a seller on Craigslist. PYUSD hints at the next generation of P2P commerce, with the liquidity enabled by PayPal as an offramp, but with the interoperability of the blockchain.
Seamless on/offramping
Currently, off-ramping has terrible UI. It’s expensive and overall incredibly inefficient. PayPal is positioned to be one of the premier off-ramps that create a ton of value and better accessibility for end consumers all over the world.
When users have more options to off-ramp easily, decentralized commerce is more viable. Our off-ramp offering satisfies the long sought-after ease of use, lowering the barrier for crypto payments with wider access to users.
While we don’t know what’s coming up on PayPal’s roadmap, our hunch is that dedicated tooling to support such integrations is a soon-to-be reality, and will allow us to significantly enhance the usability and everyday applicability of apps like PYUSD.to.
Interop with web2 fintech networks will completely change the TAM of crypto.
We will continue to play at this intersection of web3 and web2 commerce. If you also see the immense potential of combining these ecosystems, we’d love to connect.
Jump on over to The Garden and drop your info – we’d love your thoughts, feedback and ideas for how we might collaborate in the future.