Book a free call

How to Build an ERC-404 Token Wallet That Handles Hybrid Assets

An ERC-404 wallet must show fungible balances and NFTs from one hybrid token, and handle the mint-and-burn that follows every transfer. Here is how to build it.

Hertiv engineering teamReviewed by a senior engineer
7 min read
How to Build an ERC-404 Token Wallet That Handles Hybrid Assets
On this page

Short answer

An ERC-404 token wallet treats one hybrid token as both a fungible balance and a set of NFTs, because the standard mints an NFT when a wallet holds a whole token and burns it when the balance drops below one. Building one means reading both the ERC-20 balance and the ERC-721 token IDs, showing them as one position, and warning users before a transfer burns an NFT.

What is an ERC-404 token wallet?

An ERC-404 token wallet is a wallet built to hold a hybrid token that behaves as both a fungible token and an NFT. ERC-404 is an experimental standard that merges ERC-20 and ERC-721 in a single contract, so one token can be split and traded like a coin while a whole unit also carries a unique NFT.

The standard is unofficial: it has no approved Ethereum Improvement Proposal, and it was launched in February 2024 by the Pandora team under the names ctrl and Acme. That status matters for a wallet builder, because the rules of the standard can change, the contract code varies between projects, and most existing wallets do not understand the hybrid behaviour at all.

A normal wallet shows two separate things: a token balance and a list of NFTs. An ERC-404 wallet must show one position that is both, because the NFT appears and disappears as the balance crosses whole numbers. If the wallet only shows the balance, the user cannot see the NFT; if it only shows the NFT, the user cannot see the fractions.

How does the mint-and-burn mechanism change what a wallet must show?

ERC-404 mints and burns NFTs automatically as balances change. When a wallet's balance reaches a whole token, the contract mints an NFT to that wallet. When the balance drops below a whole token, the contract burns the NFT. The wallet does not trigger this; the contract does it on every transfer.

BalanceWhat the wallet holds
0.5 tokensHalf a token, no NFT
1.0 tokensOne token and one NFT
2.5 tokensTwo and a half tokens and two NFTs
1.9 tokens after selling 0.6One token, one NFT, and 0.9 of a token

The wallet must therefore track two views of the same asset and keep them in sync. The fungible view comes from the ERC-20 balance, and the NFT view comes from the ERC-721 token IDs owned by the address. A transfer that looks like a simple token sale can burn an NFT the user thought they owned, so the wallet must warn before the user confirms.

The standard uses a technique called pathing, which packs token amounts and token IDs into shared storage to save gas. That is an implementation detail, but it explains why some ERC-404 contracts behave slightly differently from each other. A wallet should read the contract's actual state rather than assume every ERC-404 project works the same way.

What does the wallet architecture look like?

An ERC-404 wallet has the same layers as a normal wallet, plus a hybrid asset layer that joins the two views. The layers are a key manager, a chain reader, the hybrid layer, and the interface, and each one has a job that the others depend on.

LayerJob
Key managerHolds keys, signs transactions, never exposes the secret
Chain readerReads balances, token IDs, metadata and events
Hybrid layerJoins the ERC-20 balance and the ERC-721 IDs into one position
InterfaceShows the position, previews transfers and warns about burns

The hybrid layer is the new part. It listens for transfer events, recalculates how many whole tokens the address holds, and updates the NFT list to match. It also fetches the metadata for each NFT, because an ERC-404 NFT without its image and traits looks like a blank row. Cache that metadata, but refresh it after every transfer.

Use a well-known provider for the chain data, such as an indexed API, rather than reading raw chain logs yourself. The wallet still needs to verify the important facts on-chain before a transaction, but the day-to-day display can come from the index. A crypto wallet built this way stays fast without trusting the index for money movement.

How do you build it, step by step?

Build an ERC-404 wallet by starting from a normal ERC-20 wallet and adding the hybrid layer, rather than building a new wallet from scratch. The steps below assume an Ethereum wallet that already handles keys, signing and token display.

  1. Add ERC-404 contract support. Detect the standard from the contract's interface and read both the fungible balance and the owned token IDs.
  2. Build the hybrid position view. Show the total balance, the number of whole tokens, the NFTs owned, and the fractional remainder in one place.
  3. Add transfer previews. Before a user confirms a transfer, show the balance after the transfer and whether an NFT will be minted or burned.
  4. Handle metadata. Fetch each NFT's image and traits from its token URI, cache them, and refresh after transfers.
  5. Add the burn warning. If a transfer drops the balance below a whole token, show a clear warning naming the NFT that will be burned.
  6. Test against real contracts. Test on Pandora and at least one other ERC-404 project, because implementations differ.
  7. Audit the signing path. Get a smart contract audit for any contract code you ship, and review the wallet's signing flow for approval tricks.

Ship the read-only views first and the transfer flow second. A wallet that shows the position correctly but cannot yet transfer is useful on day one, while a wallet that transfers without a burn warning is dangerous from the first transaction.

What security and compatibility risks need handling?

The biggest risk is that ERC-404 is experimental. The standard has no approved proposal, so a project can change its contract, and a wallet that assumes one behaviour can misread another. Pin the wallet to the exact contract versions you tested, and treat untested ERC-404 contracts as unsupported.

The second risk is the burn surprise. A user who sells a fraction of a token may not know the NFT goes with it, and the loss feels like a bug even though the contract worked as designed. The preview and the warning are the fix, and they belong in the interface, not in a help page.

The third risk is approval abuse. A malicious contract can ask a wallet for a wide token approval and then drain the balance, which in an ERC-404 token also burns the NFTs. Show the exact approval amount, default to the amount needed for one transaction, and let users revoke approvals from the wallet. Keep keys in the device's secure store, and never ask a user to paste a secret phrase into a web page.

Compatibility is the fourth risk. Most wallets, marketplaces and indexers do not understand ERC-404, so an NFT that exists in your wallet may not appear in a marketplace, and a marketplace sale may not update your wallet's view. Test the full journey, buy, hold, sell a fraction, sell the rest, against the services your users actually use.

Example: a collector who sells half a token

Example (hypothetical): a collector holds 2.5 tokens of an ERC-404 art project. The wallet shows a balance of 2.5 tokens and two NFTs, because two whole tokens each carry an NFT and the remaining 0.5 is a fraction with no NFT.

The collector sells 0.6 tokens. The new balance is 2.5 minus 0.6, or 1.9 tokens. One whole token remains, so one NFT stays and the other is burned by the contract. The wallet preview shows this before the sale: balance after the sale 1.9 tokens, one NFT kept, one NFT burned.

The collector then buys 0.1 tokens, taking the balance back to 2.0. A new NFT is minted to the wallet, so the position is two tokens and two NFTs again, but the new NFT is a different token ID with different traits from the one that was burned. The wallet shows the new ID clearly, because treating it as the same NFT would mislead the owner.

What are the common mistakes?

The most common mistakes in an ERC-404 wallet are showing only the balance, hiding the burn, assuming all contracts behave alike, and trusting an index for the final state.

  • Showing only the fungible balance. The user cannot see the NFT, so they sell a fraction and lose an asset they did not know they had.
  • No burn warning. A transfer preview without the burn result is incomplete. Name the NFT that will be burned.
  • Assuming every ERC-404 contract works the same way. Implementations differ, so test each project you support and pin the versions.
  • Trusting the indexer for money movement. Use the index for display, but read the chain before a transaction and after it confirms.
  • Treating the standard as settled. ERC-404 has no approved proposal, so build the wallet so the hybrid layer can be updated without rebuilding the whole app.

Key takeaways

  • ERC-404 is an experimental hybrid of ERC-20 and ERC-721, with no approved proposal
  • A whole token mints an NFT; dropping below a whole token burns it
  • The wallet must show the balance and the NFTs as one position, not two
  • Every transfer preview must state whether an NFT will be minted or burned
  • Test against real contracts, because ERC-404 implementations differ
  • Use an index for display, but read the chain before and after a transaction

Frequently asked questions

What is an ERC-404 token?

ERC-404 is an experimental token standard that combines ERC-20 and ERC-721 in one contract, so a token can be split and traded like a coin while a whole unit also carries a unique NFT. It was launched in February 2024 by the Pandora team, and it has no approved Ethereum Improvement Proposal, so it remains unofficial.

Why does my NFT disappear when I sell part of an ERC-404 token?

Because the contract mints an NFT when your balance reaches a whole token and burns it when the balance drops below one. Selling a fraction that takes you from 2.0 to 1.9 tokens burns one NFT. The burn is the contract working as designed, not a bug, which is why a good wallet warns you before the sale.

Can I use an ERC-404 token in a normal wallet?

A normal wallet usually shows only the fungible balance, because it reads the token as an ERC-20. The NFTs may not appear at all, and the wallet will not warn you before a transfer burns one. You need a wallet that reads both the balance and the token IDs to see the full position.

Is ERC-404 safe to build on?

It is experimental, so build with care. Pin your wallet to the contract versions you tested, warn users before any transfer that mints or burns an NFT, and get an audit for any contract code you ship. The standard may change, so keep the hybrid logic in a layer you can update without rebuilding the wallet.

Do marketplaces support ERC-404 NFTs?

Support varies, because most marketplaces and indexers were built for ERC-721 and do not understand the hybrid behaviour. An NFT that exists in your wallet may not appear on a marketplace, and a sale there may not update your wallet's view. Test the full journey on the services your users actually use.

What is pathing in ERC-404?

Pathing is a storage technique in ERC-404 contracts that packs token amounts and token IDs into shared space to save gas. It is an implementation detail, but it explains why contracts from different projects can behave slightly differently. A wallet should read the contract's actual state rather than assume one behaviour fits every project.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: blockchain systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building a wallet for hybrid tokens? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Crypto Wallet service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call