Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article examines ERC5095, a proposal for principal tokens that represent a claim to ERC20 assets.
This article translates, summarizes, and expands on the proposal below.
I have also covered a range of other EIPs.
Overview
A principal token represents ownership of a particular ERC20 token at a future date. In addition to standard ERC20 transfers, ERC5095 provides operations for deposits, withdrawals, and balance queries. It also accommodates the signature-based approval mechanism defined by ERC2612, using ERC712-formatted signatures.
For more on ERC2612, see the following article.
[ERC2612] Combining ERC20 approve and transferFrom in a single transaction
Motivation
Principal token designs have historically lacked a common standard, with each project using a different implementation. Examples include yield tokenization platforms, which separate future yield from principal and tokenize the principal alone, and fixed-rate money markets, which use principal tokens as collateral for fixed-rate borrowing and lending. Each implements principal tokens in its own way.
These incompatible implementations make integration into applications and wallets difficult. Developers have to write different adapters for each principal token and additional adapters for the corresponding pool and custody contracts. This consumes substantial development resources unnecessarily and holds back the growth of the broader ecosystem.
Specification
A principal token (PT) represents a claim that can be redeemed for a specified ERC20 token in the future.
EIP-20 implementation is mandatory
All PTs must implement ERC20.
They therefore support standard functions such as balanceOf (balance queries), transfer (transfers), and totalSupply (total supply).
All these operations apply to the balances of the PT itself.
A PT may be made non-transferable by implementing transfer and transferFrom so that calls revert.
Metadata extensions are mandatory
The ERC20 metadata extensions, including name and symbol, must be implemented.
The token name and symbol should reflect the underlying token's name and the issuing protocol whenever possible.
For yield tokenization protocols in particular, they should indicate the money market from which the PT was issued.
Optional ERC2612 support for better approvals
To improve the user experience, implementations may optionally support ERC2612, which enables signature-based approvals. This allows users to grant permission to spend their tokens while saving on gas fees.
Terminology
-
underlying (underlying token)
- The ERC20 token for which a PT can be redeemed at maturity.
-
maturity
- The Unix timestamp at which a PT becomes redeemable.
- At or after this time, PTs can be exchanged for the underlying token.
-
fee
- A fee charged to PT users.
- Fees may apply to redemption at maturity or to yield generated after redemption.
-
slippage
- The difference between the quoted redemption value and the amount actually received.
- Slippage may occur even when it is not explicitly identified as a fee.
Functions
underlying
Returns the address of the token for which the principal token is redeemable at maturity.
The underlying token must comply with ERC20.
- name: underlying
type: function
stateMutability: view
inputs: []
outputs:
- name: underlyingAddress
type: addressmaturity
Returns the Unix timestamp at which principal tokens become redeemable.
- name: maturity
type: function
stateMutability: view
inputs: []
outputs:
- name: timestamp
type: uint256convertToUnderlying
Calculates the amount of underlying tokens that could be exchanged for a specified amount of principal tokens under ideal conditions.
- Excludes fees.
- The result must not vary depending on the caller.
- Does not account for actual slippage or on-chain conditions.
- Must not revert except on integer overflow.
- Rounds down fractional amounts.
- name: convertToUnderlying
type: function
stateMutability: view
inputs:
- name: principalAmount
type: uint256
outputs:
- name: underlyingAmount
type: uint256convertToPrincipal
Calculates the amount of principal tokens required to obtain the specified amount of underlying tokens.
It is the inverse of convertToUnderlying.
- Excludes fees.
- The result must not vary depending on the caller.
- Does not account for slippage or on-chain conditions.
- Must not revert except on integer overflow.
- Rounds down fractional amounts.
- name: convertToPrincipal
type: function
stateMutability: view
inputs:
- name: underlyingAmount
type: uint256
outputs:
- name: principalAmount
type: uint256maxRedeem
Returns the maximum amount of principal tokens that the specified address can redeem.
- Must not return more than the actual limit (underestimate if necessary).
- Must account for any global or user-specific limits.
- Returns
0if redemption is temporarily disabled. - Must not revert.
- name: maxRedeem
type: function
stateMutability: view
inputs:
- name: holder
type: address
outputs:
- name: maxPrincipalAmount
type: uint256previewRedeem
Simulates the amount of underlying tokens a user would receive from a redemption under current on-chain conditions before actually redeeming.
- Includes fees.
- Ignores usage limits (such as
maxRedeem) and balance checks, returning the theoretical maximum amount obtainable. - May revert under certain conditions (when an actual redemption would also revert).
- A discrepancy from
convertToUnderlyingis treated as slippage.
- name: previewRedeem
type: function
stateMutability: view
inputs:
- name: principalAmount
type: uint256
outputs:
- name: underlyingAmount
type: uint256redeem
Burns the specified amount of principal tokens and transfers the corresponding amount of underlying tokens to the designated recipient.
Can only be executed at or after maturity.
- Must emit a
Redeemevent. msg.sendermust be the token holder or have been granted an ERC20 approval.- Must revert if
redeemfails, such as because of an insufficient balance or an exceeded limit. - Some protocols may require a separate request before burning.
- name: redeem
type: function
stateMutability: nonpayable
inputs:
- name: principalAmount
type: uint256
- name: to
type: address
- name: from
type: address
outputs:
- name: underlyingAmount
type: uint256maxWithdraw
Returns the maximum amount of underlying tokens that the specified address can withdraw.
- Must not return more than the actual limit (underestimate if necessary).
- Must account for any global or user-specific limits.
- Returns
0ifwithdrawis temporarily disabled. - Must not revert.
- name: maxWithdraw
type: function
stateMutability: view
inputs:
- name: holder
type: address
outputs:
- name: maxUnderlyingAmount
type: uint256previewWithdraw
Simulates how many principal tokens must be burned for a withdraw operation under current on-chain conditions.
- Includes fees.
- Ignores usage limits (such as
maxWithdraw) and balance checks, returning the theoretical required amount. - May revert under the same conditions as
withdraw. - A discrepancy from
convertToPrincipalis treated as slippage.
- name: previewWithdraw
type: function
stateMutability: view
inputs:
- name: underlyingAmount
type: uint256
outputs:
- name: principalAmount
type: uint256withdraw
Burns the corresponding amount of principal tokens to obtain a specified amount of underlying tokens.
- Must emit a
Redeemevent. msg.sendermust be the token holder or have been granted an ERC20 approval.- Must revert if the conditions for execution are not met, such as because of an insufficient balance or an exceeded limit.
- Some protocols may require a separate request before burning.
Events
Event specification
Redeem
Emitted when a user redeems principal tokens and receives the corresponding underlying tokens.
The following conditions must be met.
-
Must be emitted when
redeemis called and the principal tokens are burned. -
Records that
underlyingtokens were transferred to the user. -
from- The address whose principal tokens were redeemed (indexed).
-
to- The address that received the underlying tokens (indexed).
-
amount- The amount of underlying tokens transferred (not indexed).
This event allows observers to track redemptions and their recipients through logs.
It also helps external applications such as wallets and block explorers visualize user activity.
Additional considerations
For ease of integration, the principal token interface is designed around a minimal core with optional extensions where needed.
The specification does not prescribe internal accounting or how the underlying asset is managed.
This is because principal tokens are treated as black boxes on-chain, with their actual implementation expected to be examined off-chain.
Relationship to ERC20
Since principal tokens comply with ERC20, the usual functions, such as approve for approvals and balanceOf for balance queries, are available.
As a result, principal tokens can be used not only for ERC5095-specific use cases but also in existing ERC20-compatible wallets and DeFi protocols.
Why redemption matters
All principal tokens become redeemable for the underlying token at maturity.
Users and protocols can therefore purchase principal tokens on the open market and later call redeem to realize a fixed yield.
The design is intended to make the principal token identifiable and usable through the redemption function alone.
Differences from ERC4626
Technically, principal tokens can be regarded as a subset of ERC4626, the yield-bearing vault standard.
Directly inheriting ERC4626, however, would require implementing functions such as mint and deposit, which PTs do not need.
Partial redemptions are also less common for principal tokens, making the vault interface a poor fit for this use case.
For these reasons, the proposal defines a separate specification rather than adopting ERC4626.
For more on ERC4626, see the following article.
[ERC4626] Understanding the Tokenized Vault Standard
No dedicated maturity event
Principal tokens mature at a particular Unix timestamp, but a contract cannot emit events autonomously. It is therefore difficult to provide an event that signals the exact moment of maturity.
Applications that need to detect maturity must either observe the Redeem event when a token is first redeemed or track each PT's maturity timestamp themselves.
Backwards compatibility
The specification is fully compatible with ERC20.
It can be integrated into existing ERC20-based wallets and applications.
Reference implementation
// SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import {ERC20} from "yield-utils-v2/contracts/token/ERC20.sol";
import {MinimalTransferHelper} from "yield-utils-v2/contracts/token/MinimalTransferHelper.sol";
contract ERC5095 is ERC20 {
using MinimalTransferHelper for ERC20;
/* EVENTS
*****************************************************************************************************************/
event Redeem(address indexed from, address indexed to, uint256 underlyingAmount);
/* MODIFIERS
*****************************************************************************************************************/
/// @notice A modifier that ensures the current block timestamp is at or after maturity.
modifier afterMaturity() virtual {
require(block.timestamp >= maturity, "BEFORE_MATURITY");
_;
}
/* IMMUTABLES
*****************************************************************************************************************/
ERC20 public immutable underlying;
uint256 public immutable maturity;
/* CONSTRUCTOR
*****************************************************************************************************************/
constructor(
string memory name_,
string memory symbol_,
uint8 decimals_,
ERC20 underlying_,
uint256 maturity_
) ERC20(name_, symbol_, decimals_) {
underlying = underlying_;
maturity = maturity_;
}
/* CORE FUNCTIONS
*****************************************************************************************************************/
/// @notice Burns an exact amount of principal tokens in exchange for an amount of underlying.
/// @dev This reverts if before maturity.
/// @param principalAmount The exact amount of principal tokens to be burned.
/// @param from The owner of the principal tokens to be redeemed. If not msg.sender then must have prior approval.
/// @param to The address to send the underlying tokens.
/// @return underlyingAmount The total amount of underlying tokens sent.
function redeem(
uint256 principalAmount,
address from,
address to
) public virtual afterMaturity returns (uint256 underlyingAmount) {
_decreaseAllowance(from, principalAmount);
// Check for rounding error since we round down in previewRedeem.
require((underlyingAmount = _previewRedeem(principalAmount)) != 0, "ZERO_ASSETS");
_burn(from, principalAmount);
emit Redeem(from, to, principalAmount);
_transferOut(to, underlyingAmount);
}
/// @notice Burns a calculated amount of principal tokens in exchange for an exact amount of underlying.
/// @dev This reverts if before maturity.
/// @param underlyingAmount The exact amount of underlying tokens to be received.
/// @param from The owner of the principal tokens to be redeemed. If not msg.sender then must have prior approval.
/// @param to The address to send the underlying tokens.
/// @return principalAmount The total amount of underlying tokens redeemed.
function withdraw(
uint256 underlyingAmount,
address from,
address to
) public virtual afterMaturity returns (uint256 principalAmount) {
principalAmount = _previewWithdraw(underlyingAmount); // No need to check for rounding error, previewWithdraw rounds up.
_decreaseAllowance(from, principalAmount);
_burn(from, principalAmount);
emit Redeem(from, to, principalAmount);
_transferOut(to, underlyingAmount);
}
/// @notice An internal, overridable transfer function.
/// @dev Reverts on failed transfer.
/// @param to The recipient of the transfer.
/// @param amount The amount of the transfer.
function _transferOut(address to, uint256 amount) internal virtual {
underlying.safeTransfer(to, amount);
}
/* ACCOUNTING FUNCTIONS
*****************************************************************************************************************/
/// @notice Calculates the amount of underlying tokens that would be exchanged for a given amount of principal tokens.
/// @dev Before maturity, it converts to underlying as if at maturity.
/// @param principalAmount The amount principal on which to calculate conversion.
/// @return underlyingAmount The total amount of underlying that would be received for the given principal amount..
function convertToUnderlying(uint256 principalAmount) external view returns (uint256 underlyingAmount) {
return _convertToUnderlying(principalAmount);
}
function _convertToUnderlying(uint256 principalAmount) internal view virtual returns (uint256 underlyingAmount) {
return principalAmount;
}
/// @notice Converts a given amount of underlying tokens to principal exclusive of fees.
/// @dev Before maturity, it converts to principal as if at maturity.
/// @param underlyingAmount The total amount of underlying on which to calculate the conversion.
/// @return principalAmount The amount principal tokens required to provide the given amount of underlying.
function convertToPrincipal(uint256 underlyingAmount) external view returns (uint256 principalAmount) {
return _convertToPrincipal(underlyingAmount);
}
function _convertToPrincipal(uint256 underlyingAmount) internal view virtual returns (uint256 principalAmount) {
return underlyingAmount;
}
/// @notice Allows user to simulate redemption of a given amount of principal tokens, inclusive of fees and other
/// current block conditions.
/// @dev This reverts if before maturity.
/// @param principalAmount The amount of principal that would be redeemed.
/// @return underlyingAmount The amount of underlying that would be received.
function previewRedeem(uint256 principalAmount) external view afterMaturity returns (uint256 underlyingAmount) {
return _previewRedeem(principalAmount);
}
function _previewRedeem(uint256 principalAmount) internal view virtual returns (uint256 underlyingAmount) {
return _convertToUnderlying(principalAmount); // should include fees/slippage
}
/// @notice Calculates the maximum amount of principal tokens that an owner could redeem.
/// @dev This returns 0 if before maturity.
/// @param owner The address for which the redemption is being calculated.
/// @return maxPrincipalAmount The maximum amount of principal tokens that can be redeemed by the given owner.
function maxRedeem(address owner) public view returns (uint256 maxPrincipalAmount) {
return block.timestamp >= maturity ? _balanceOf[owner] : 0;
}
/// @notice Allows user to simulate withdraw of a given amount of underlying tokens.
/// @dev This reverts if before maturity.
/// @param underlyingAmount The amount of underlying tokens that would be withdrawn.
/// @return principalAmount The amount of principal tokens that would be redeemed.
function previewWithdraw(uint256 underlyingAmount) external view afterMaturity returns (uint256 principalAmount) {
return _previewWithdraw(underlyingAmount);
}
function _previewWithdraw(uint256 underlyingAmount) internal view virtual returns (uint256 principalAmount) {
return _convertToPrincipal(underlyingAmount); // should include fees/slippage
}
/// @notice Calculates the maximum amount of underlying tokens that can be withdrawn by a given owner.
/// @dev This returns 0 if before maturity.
/// @param owner The address for which the withdraw is being calculated.
/// @return maxUnderlyingAmount The maximum amount of underlying tokens that can be withdrawn by a given owner.
function maxWithdraw(address owner) public view returns (uint256 maxUnderlyingAmount) {
return _previewWithdraw(maxRedeem(owner));
}
}Security considerations
The principal token design is permissionless, meaning anyone can deploy a token. A token may therefore expose an interface that complies with the specification while containing malicious logic. For example, a token might trade freely on a market even though its redemption logic is not properly implemented.
Given these risks, applications and protocols should always review a principal token's implementation before integrating it.
convertToUnderlying is only an estimate
The convertToUnderlying function is useful for display purposes and user-facing estimates, but its result does not have to exactly match the amount of underlying tokens that can actually be redeemed.
Matching decimals
As with many other standards, a principal token's precision (decimals) should match that of its underlying token whenever possible.
This helps prevent confusion in frontend displays and in integrations with external tools and wallets.
In financial applications in particular, mismatched decimal precision can cause serious bugs or misinterpretations.
Citation
Julian Traversa (@JTraversa), Robert Robbins (@robrobbins), Alberto Cuesta Cañada (@alcueca), "ERC-5095: Principal Token [DRAFT]," Ethereum Improvement Proposals, no. 5095, May 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-5095.
Conclusion
This article covered ERC5095, a proposal for principal tokens representing a claim to ERC20 assets. I hope you found it useful.
If you have any questions, feel free to contact me via Twitter DM.
I also publish on other platforms, which you can find below.



