In the rapidly evolving world of Web3, user experience and security remain top priorities—especially when it comes to digital asset management. Trust Wallet, serving over 122 million users worldwide, has long been at the forefront of innovation in crypto wallet technology. In February 2024, we launched Trust Wallet SWIFT, an account abstraction-powered wallet that redefined convenience and security with features like passkey login, gas payment in 200+ tokens, and one-step swaps and bridging.
What made SWIFT truly groundbreaking was its foundation: Barz, Trust Wallet’s proprietary smart contract wallet solution. Today, we’re excited to announce that Barz is now open source, inviting developers and builders to explore, contribute, and innovate on a secure, modular, and future-ready smart wallet architecture.
👉 Discover how next-gen wallet technology is shaping the future of Web3.
Why We Built Barz
Despite growing adoption, many users still face persistent challenges when interacting with blockchain wallets:
- Mnemonic phrase mismanagement: Losing seed phrases often means losing access to funds—forever.
- Excessive dApp permissions: Users frequently grant broad approvals for simple transactions, exposing themselves to potential exploits.
- Lack of automation: There's no native way to schedule recurring payments or set up conditional transactions.
These pain points not only hinder usability but also pose real security risks—especially for newcomers. As Web3 onboards more users, the need for smarter, more secure wallet solutions becomes critical.
To address these issues at their core, Trust Wallet developed Barz, a smart contract wallet built on ERC-4337 (Account Abstraction). This approach eliminates private key dependency for daily operations, enhances security through programmable controls, and unlocks advanced functionalities previously unavailable in traditional EOAs (Externally Owned Accounts).
What Is Barz?
Barz is an ERC-4337-compliant smart contract wallet designed for modularity, upgradability, and robust security. It leverages the Diamond Proxy Pattern (EIP-2535)—a cutting-edge smart contract architecture that enables flexible, secure, and scalable upgrades without disrupting user accounts.
Unlike conventional proxy patterns such as UUPS or Transparent Proxies—which route all calls to a single implementation contract—Barz uses a multi-faceted proxy system. Each function group (or "facet") operates independently, allowing granular control over features while minimizing attack surface.
This means Barz can evolve over time—adding new capabilities like biometric authentication or automated transaction rules—without requiring users to migrate funds or change addresses.
Core Features of Barz
Barz currently supports 12 fully implemented facets, each focused on a specific functionality:
- Account Recovery: Regain access without seed phrases using trusted guardians or social recovery mechanisms.
- Lock: Temporarily freeze the wallet to prevent unauthorized transactions.
- Signature Migration: Seamlessly transition from traditional ECDSA signatures to modern schemes like passkeys.
- Guardian System: Assign trusted entities to co-sign or approve high-value transactions.
- Transaction Restrictions: Enforce custom rules (e.g., daily spending limits, whitelisted contracts).
Multiple Validation Mechanisms:
- Secp256k1: Standard EVM signature scheme (used with mnemonic phrases)
- Secp256r1: Enables integration with passkeys (WebAuthn), Okta, and other identity providers
- Multi-sig: Require multiple signers for transaction execution
These facets work together to deliver a smarter, more resilient wallet experience—one that adapts to user needs rather than forcing users to adapt to rigid blockchain limitations.
The Power of the Diamond Proxy Pattern
At the heart of Barz lies the Diamond Proxy Pattern (EIP-2535), which allows different parts of a smart contract to be upgraded independently. Think of it like a modular smartphone: you can upgrade the camera without replacing the battery or screen.
Each "facet" in Barz contains logic for a specific feature (e.g., recovery, signing, restrictions). The Diamond proxy routes function calls to the appropriate facet based on method selectors—ensuring efficient, secure execution.
Compared to monolithic contracts or single-proxy systems, this design offers:
- Higher security: Smaller code surface per facet reduces vulnerability risk.
- Flexible upgrades: New features can be added without downtime or migrations.
- Improved auditability: Each facet can be reviewed independently.
- Gas efficiency: Only relevant components are loaded during execution.
We’ve further optimized the Diamond pattern for Barz by introducing stricter access controls, enhanced initialization safeguards, and streamlined facet management—setting a new standard for secure smart wallet development.
👉 See how modular wallet design is revolutionizing user control in decentralized finance.
Driving Innovation Through Open Source
By open-sourcing Barz on GitHub, we’re empowering developers to build upon a battle-tested, production-ready smart wallet framework. Whether you're creating a custodial solution, a DeFi platform with embedded wallets, or a self-custodial app with advanced UX features, Barz provides the foundation.
Our upcoming four-part article series will dive deeper into:
- Introducing Barz: Trust Wallet’s Smart Wallet Solution (this article)
- Cutting Diamonds: How to Make Accounts Awesome – Exploring our custom optimizations to the Diamond pattern
- For Builders By Builders: Introducing the Barz SDK – Tools and APIs for seamless integration
- Multi-Tier Module System: A Secure Foundation for Open Innovation – Our vision for extensible, interoperable wallet modules
Stay tuned for these deep dives—and join us in shaping the next generation of Web3 wallets.
Frequently Asked Questions
Q: What is account abstraction (ERC-4337)?
A: Account abstraction replaces traditional externally owned accounts (EOAs) with smart contract wallets. This allows features like gas sponsorship, batched transactions, and alternative authentication methods (e.g., passkeys), improving both security and UX.
Q: Is Barz safe to use?
A: Yes. Barz is built with security-first principles, leveraging well-audited patterns like Diamond Proxy and incorporating multiple validation schemes. It has been tested in production via Trust Wallet SWIFT before being open-sourced.
Q: Can I upgrade my existing wallet to use Barz?
A: While direct migration isn’t required, developers can integrate Barz into new applications or services. End users benefit when platforms adopt Barz-based wallets—no action needed on their part.
Q: Does Barz support passkeys?
A: Yes. Barz is one of the first production-ready ERC-4337 wallets supporting passkeys via Secp256r1, enabling passwordless, phishing-resistant login experiences.
Q: How does Barz handle upgrades?
A: Using the Diamond Proxy Pattern, individual facets can be upgraded without affecting the entire contract. This ensures continuous improvement while maintaining user fund safety and address persistence.
Q: Where can developers get started with Barz?
A: Visit the official GitHub repository at github.com/trustwallet/barz for code, documentation, and contribution guidelines.
👉 Start building smarter wallets today with advanced account abstraction tools.
Final Thoughts
Barz represents a major leap forward in smart wallet design—combining modular architecture, strong security practices, and user-centric innovation. As Trust Wallet continues to push the boundaries of what’s possible in Web3, we believe open collaboration is key to mass adoption.
By sharing Barz with the global developer community, we’re not just releasing code—we’re inviting builders to co-create the future of digital ownership.
Follow our blog and Discord for updates on the Barz series and upcoming SDK releases. Together, let’s build a safer, smarter Web3.
Keywords: smart contract wallet, account abstraction, ERC-4337, Diamond Proxy Pattern, Barz, Trust Wallet SWIFT, modular wallet, passkey authentication