Skip to main content

OP_20 Standard

Introduction

The OP_20 standard is OP_NET's equivalent to Ethereum’s ERC-20, enabling developers to create and manage fungible tokens directly on Bitcoin.

Use Cases for OP_20 Tokens

Developers can use OP_20 tokens for various applications, including stablecoins, loyalty points, and decentralized finance (DeFi) protocols.


Why OP_20?

Key Features of OP_20
  • Fungibility: All OP_20 tokens are identical and interchangeable, suitable for currencies, stablecoins, and more.
  • Bitcoin-Native: Built on Bitcoin’s base layer, ensuring unmatched security and compatibility.
  • Low Costs: Transaction fees are paid in satoshis, keeping costs low and predictable.
  • Customizability: Supports advanced features like minting, burning, and allowances.

How OP_20 Works

1. Contract Deployment

An OP_20 token contract is deployed using a Tapscript script, defining the token’s metadata and behavior.

  • Token Name: The human-readable name of the token.
  • Symbol: The shorthand identifier (e.g., BTC, USD).
  • Total Supply: The maximum number of tokens that can exist.

2. Token Interactions

OP_20 supports standard interactions, including:

  • Transfer: Sending tokens between users.
  • Approve: Granting permissions to another address to spend tokens on your behalf.
  • TransferFrom: Allowing approved addresses to transfer tokens on your behalf.
  • ...and more.

3. Gas and UTXOs

Gas fees are paid in Bitcoin, and token transactions leverage Bitcoin’s UTXO model for efficiency and scalability.


Advantages of OP_20

1. Bitcoin’s Security

By building on Bitcoin’s base layer, OP_20 tokens inherit the security and decentralization of Bitcoin.

2. Flexibility

OP_20 tokens can be customized to fit various use cases, from stablecoins to loyalty points.

3. Compatibility

OP_20 is designed to work seamlessly with Bitcoin wallets, dApps, and infrastructure.


Permission System

The permission system in these standards mirrors the established user experience of ERC standards:

  1. One-Time Approvals: Users grant permission once to a contract or marketplace to interact with their tokens. For example:

    • When first using a decentralized exchange, a user grants approval for the exchange to access their tokens.
    • Subsequently, they can execute trades without additional permission steps.
  2. Revoking Permissions: Users retain full control and can revoke permissions at any time, maintaining security while ensuring a smooth user experience.


Future Enhancements

Looking beyond mainnet, OP_NET is exploring enhanced token standards that improve upon the current permission model:

  • Single Atomic Transactions: Users will be able to approve and transfer specific token amounts in one atomic transaction.
  • Improved User Experience: These enhancements aim to reduce transaction steps and associated costs while maintaining the security benefits of the permission system.
  • DeFi Benefits: Especially valuable for decentralized exchanges and other DeFi applications where rapid token interactions are common.

Unified Account Integration

OP_NET’s unified account system ensures that tokens can be managed using a single public key, simplifying asset management.

For more information, refer to Unified Accounts.