Introducing Porto: Next-generation account for unstoppable applications
Table of Contents
Announcing Porto, a developer-first Typescript library that enables authentication, crypto payments, and account recovery to be seamlessly integrated into your app or existing toolkit (e.g. Wagmi, Privy, etc). Our vision for Porto is to be the invisible infrastructure that powers next-generation applications.
We invite application and wallet developers to try it out and give us feedback. Try it now: npm install porto
, star and contribute to the library, or check out the smart contract.
Porto is really simple and powerful, featuring the latest innovations in account abstraction wallets, like EIP-7702, RIP-7212, EIP-6963, and EIP-5792. It’s already live with popular developer tools in this space, like Wagmi or Privy.
Here is a simple example of how to use Porto to connect an account to an application.
import { Porto } from 'porto'
const porto = Porto.create()
const account = await porto.provider.request({
method: 'experimental_connect',
params: [{ capabilities: { grantSession: true } }]
})
Continue reading to learn more about how Porto works and how you can get involved.
Crypto-powered accounts can be better.
Every app needs an account, traditionally requiring separate services for auth, payments, and recovery. Doing this in a way that empowers users with control over their funds and their data is the core challenge of the crypto space. While crypto wallets have made great strides, users still face a fragmented experience - juggling private keys, managing account balances across networks, having to install browser extensions, and more.
We believe that unstoppable crypto-powered accounts should be excellent throughout a user’s journey:
- Onboarding: No key management using WebAuthn and Passkeys. KYC-less fiat onramping. No kicking of the user to 3rd party applications, fully embedded experience with headless wallet.
- Verifying their identity: Privacy-preserving identity verification with ZK Passport or other techniques.
- Transacting safely: Access control policies baked in with sensible defaults in smart contracts.
- Transacting privately: Built-in privacy using stealth addresses and confidential transactions.
- Transacting seamlessly across chains: Single address with automatic gas handling across chains using ERC7683.
- Recovering their account: Multi-path recovery via social, email, OAuth, or other identity providers.
- No vendor lock-in: No vendor lock-in, built on top of standards that have powered Ethereum for years.
Porto is our solution - a next-gen account and SDK that unifies these capabilities into one seamless experience.
Porto works across web, mobile, and desktop platforms without extensions or QR codes, bringing the wallet directly to your app.
See a live demo of using Porto with Privy below, by Henri Stern, CEO of Privy.
Technical Overview
Porto is uniquely enabled by robust standards that have powered Ethereum for years, like EIP-1193, as well as exciting upcoming hardfork features, like EIP-7702: Set Account Code. It’s simple to use and works with existing tools, like Wagmi.
To try Porto out for yourself, check out the Porto GitHub Repository or install porto
on npm. Read on to learn more details about how Porto works.
EIP-1193 Provider
EIP-1193 transformed Ethereum application development by standardizing the provider interface for wallets to communicate with apps. This allowed app developers to request accounts, react to chain changes, and more without custom code.
Porto comes with an EIP-1193-Compatible Provider that makes it easy to use WebAuthn accounts the same way you use browser extension or app-based wallets (e.g. provider.request({ method, params })
). For example, you can request the accounts associated with the passkey in the current context.
import { Porto } from 'porto'
const porto = Porto.create()
const accounts = await porto.provider.request({ method: 'eth_requestAccounts' })
Experimental JSON-RPC Methods
In order to support account-based sessions, Porto implements the following experimental JSON-RPC methods:
experimental_connect
Connects an end-user to an application.experimental_createAccount
Creates and connects a new account.experimental_disconnect
Disconnects the account.experimental_grantSession
Grants a session on the account. (Minimal alternative to the draft ERC-7715 specification. We hope to upstream concepts from this method and eventually use ERC-7715 or similar.)experimental_sessions
Lists the active sessions on the account.
Check out the JSON-RPC Reference to learn more about the experimental JSON-RPC methods and corresponding ERC 5792 capabilities or try out the Porto Playground to inspect and see how these methods work.
(Note: These JSON-RPC methods intend to be upstreamed through ERCs or deprecated in favor of upcoming/existing ERCs in the near future. They are purposefully minimalistic and intend to be iterated on.)
Wagmi Support
These days, most app developers don’t use 1193 Providers directly and instead use higher level libraries, like Wagmi, that manage state and reactivity by plugging your framework of choice (e.g. React, Vue) into EIP 1193 requests and events. For example, when a wallet provider switches chains Wagmi listens and keeps track of updates.
In addition to the built-in 1193 Provider, Porto is also compatible with Wagmi via Wagmi’s built-in EIP-6963 support. To get started, all it takes is to import and configure Porto alongside Wagmi.
import { Porto } from 'porto'
import { http, createConfig, createStorage } from 'wagmi'
import { odysseyTestnet } from 'wagmi/chains'
Porto.create()
export const wagmiConfig = createConfig({
chains: [odysseyTestnet],
transports: {
[odysseyTestnet.id]: http(),
},
})
Finally, Porto exports a collection of Wagmi VanillaJS Action and React Hooks to make building account session experiences simple. Check out the Wagmi Reference for more info or try out the Wagmi Porto Playground or see Porto in action in Privy’s “Subscriptions with EIP 7702”.
Conclusion
Porto represents our vision for what accounts should be - invisible infrastructure that just works. We’ve designed it to be unopinionated and modular, serving as the backbone for wallets that want to access novel account abstraction features.
For developers, Porto offers a simple integration path whether you want a fully embedded experience or integration with existing wallet flows. For users, it means no more context switching between apps and wallets, no more QR code scanning, and no more thinking about which chain they’re on.
What’s Next
We’re excited to work with:
- App Developers: Try integrating Porto into your applications
- Wallet Teams: Upgrade your EOA wallets to smart contract accounts using Porto. Investigate ways to integrate EIP7702 into your wallet ASAP.
- ZK Developers: Help us build privacy-preserving account features like ZK Passport or other techniques.
- Researchers: Working on proposals for new cross-chain account features such as L1SLOAD or REMOTESTATICCALL.
- Smart Contract Developers: Fork and extend the account implementation
- Infrastructure Operators: Help us run interoperability tests
The future of accounts is here - global, private, and seamlessly integrated. Join us in building it. If you’re an excellent Typescript developer, we’d love to have you join the team, please contact us if you are interested.