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.
ERC-1900 proposes a decentralized type registry called dType for Ethereum. Its aim is to standardize type definitions and ABI information so that they can be reused across applications.
This article translates, summarizes, and expands on the following proposal.
More EIP explainers:
Overview
Developing the EVM and associated languages such as Solidity into a shared computing environment, sometimes described as a world computer or global operating system, requires agreement on an extensible type system.
ERC-1900 proposes an on-chain type registry (dType) and interfaces for defining struct-based types. This provides a common representation of the information needed to reconstruct application binary interfaces (ABIs).
Motivation
Data standards are important for building interoperable Ethereum protocols.
Standardized data definitions can facilitate on-chain interactions, improve the ability of off-chain tools such as block explorers to interpret blockchain data, and allow developers to reuse existing types in new contracts.
The proposal envisages functionality beyond a type registry, including:
- A decentralized type system with data storage (identified as ERC-2158 in the original article; the dType Storage Extension is described in ERC-2157).
- Libraries of pure functions for manipulating and updating typed data (dType Functions Extension).
The broader objective is to support reusable building blocks for functional programming patterns on Ethereum.
The proposed design aims to:
- Provide a common representation of data and relationships between types.
- Make behavior associated with types addressable.
- Support operations such as
map,reduce, andfilterthrough type libraries. - Integrate with Solidity development tools such as Remix.
- Leave room for future EVM support, potentially including precompiled functionality.
- Accommodate definitions in other languages, with type source code stored in Swarm.
- Enable the dType database to serve as part of a broader Ethereum system registry.
These are design objectives rather than features automatically provided by the EVM.
Specification
Governance
A dType registry may implement governance policies for create, read, update, and delete (CRUD) operations.
ERC-1900 does not prescribe a particular governance protocol or access-control mechanism.
Type definitions and metadata
The registry supports registering elementary and composite Solidity types, as well as contract event definitions.
The proposal focuses on the minimum on-chain definitions and metadata needed to represent user-defined Solidity types.
Type definitions: TypeLibrary
A type library can contain a struct-based type definition and associated operations, such as:
isInstanceOf- Determines whether a value satisfies the constraints of a particular type.
- Higher-order functions (HOFs)
- Operations such as
map,filter, andreduce.
- Operations such as
structureBytesanddestructureBytes- Convert between structured values and byte representations, which can be useful in low-level processing and assembly-based calls.
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
library myBalanceLib {
struct myBalance {
string accountName;
uint256 amount;
}
function structureBytes(bytes memory data) pure public returns(myBalance memory balance)
function destructureBytes(myBalance memory balance) pure public returns(bytes memory data)
function isInstanceOf(myBalance memory balance) pure public returns(bool isInstance)
function map(
address callbackAddr,
bytes4 callbackSig,
myBalance[] memory balanceArr
)
view
internal
returns (myBalance[] memory result)
}A type can refer to other types, forming a directed acyclic graph (DAG) of type dependencies when cyclic references are excluded.
The excerpt illustrates the library's intended function signatures. It is not a complete compilable Solidity implementation.
Type metadata: dType Registry
Type metadata is stored in the dType registry contract and includes:
name- The type name, following Solidity naming conventions.
typeChoice- An enumeration identifying the category of definition, such as a data type, function, or event.
contractAddress- The address associated with the root definition or contract for the type.
source- A hash referencing the source definition stored in Swarm.
types- Information about constituent types, including their names, field labels, and array dimensions.
Type metadata examples
Elementary type
{
"contractAddress": "0x0000000000000000000000000000000000000000",
"typeChoice": 0,
"source": "0x...",
"name": "uint256",
"types": []
}Composite type
{
"contractAddress": "0x1056...c268",
"typeChoice": 0,
"source": "0x...",
"name": "myBalance",
"types": [
{"name": "string", "label": "accountName", "dimensions": []},
{"name": "uint256", "label": "amount", "dimensions": []}
]
}dType registry data structures
enum TypeChoices {
BaseType,
PayableFunction,
StateFunction,
ViewFunction,
PureFunction,
Event
}
struct dTypes {
string name;
string label;
string[] dimensions;
}
struct dType {
TypeChoices typeChoice;
address contractAddress;
bytes32 source;
string name;
dTypes[] types;
}
struct Type {
dType data;
uint256 index;
}
mapping(bytes32 => Type) public typeStruct;
bytes32[] public typeIndex;The identifier is generated using keccak256(abi.encodePacked(name)). The proposal also envisages including a language identifier, as in keccak256(abi.encodePacked(language, name)).
When combining multiple variable-length fields, implementers must use an unambiguous encoding to avoid packed-encoding ambiguities. Name-based identifiers also require a policy for naming conflicts and revisions.
dType registry interface
import './dTypeLib.sol';
interface dType {
event LogNew(bytes32 indexed identifier, uint256 indexed index);
event LogUpdate(bytes32 indexed identifier, uint256 indexed index);
event LogRemove(bytes32 indexed identifier, uint256 indexed index);
function insert(dTypeLib.dType calldata data) external returns (bytes32 identifier);
function remove(bytes32 identifier) external returns(uint256 index);
function count() external view returns(uint256 counter);
function getTypeIdentifier(string memory name) pure external returns (bytes32 identifier);
function getByIdentifier(bytes32 identifier) view external returns(dTypeLib.dType memory dtype);
function get(string memory name) view external returns(dTypeLib.dType memory dtype);
function isRegistered(bytes32 identifier) view external returns(bool registered);
}Events, structs, and variables
LogNew
event LogNew(bytes32 indexed identifier, uint256 indexed index);Emitted when a type is registered.
Parameters
identifier- The identifier derived using Keccak-256.
index- The corresponding position in the
typeIndexarray.
- The corresponding position in the
LogUpdate
event LogUpdate(bytes32 indexed identifier, uint256 indexed index);Emitted when an existing type definition is updated.
Parameters
identifier- The identifier of the updated type.
index- Its position in the
typeIndexarray.
- Its position in the
LogRemove
event LogRemove(bytes32 indexed identifier, uint256 indexed index);Emitted when a type is removed.
Parameters
identifier- The identifier of the removed type.
index- The index associated with the removal.
Functions
insert
function insert(dTypeLib.dType calldata data) external returns (bytes32 identifier);Registers a type definition and returns its identifier.
Parameter
data- The type metadata to register.
Return value
identifier- The generated type identifier.
remove
function remove(bytes32 identifier) external returns(uint256 index);Removes the type associated with the specified identifier.
Parameter
identifier- The identifier of the type to remove.
Return value
index- The index associated with the removed type.
count
function count() external view returns(uint256 counter);Returns the total number of registered types, represented by the length of the typeIndex array.
Return value
counter- The number of registered types.
getTypeIdentifier
function getTypeIdentifier(string memory name) pure external returns (bytes32 identifier);Derives a type identifier from its name using Keccak-256.
Parameter
name- The type name.
Return value
identifier- The derived identifier.
getByIdentifier
function getByIdentifier(bytes32 identifier) view external returns(dTypeLib.dType memory dtype);Retrieves the dType metadata associated with an identifier.
Parameter
identifier- The identifier of the requested type.
Return value
dtype- The corresponding type metadata.
get
function get(string memory name) view external returns(dTypeLib.dType memory dtype);Retrieves type metadata by name, deriving the corresponding identifier as needed.
Parameter
name- The name of the requested type.
Return value
dtype- The corresponding type metadata.
isRegistered
function isRegistered(bytes32 identifier) view external returns(bool registered);Determines whether a type identifier is registered.
Parameter
identifier- The identifier to check.
Return value
registered- True if registered; otherwise false.
Rationale
The dType registry stores the minimum information required to reconstruct ABI type definitions.
This can support:
- On-chain interoperability through shared type definitions.
- Off-chain interpretation of events and state changes, where the required ABI and storage-layout information is available.
- Development tools, such as editor plugins, that cache and search type information.
Rather than requiring each project to define unrelated types independently, the proposal envisages a shared type registry that applications and tools can use.
A governance mechanism would determine how new types are registered and how obsolete definitions are removed.
The registry could also provide a foundation for future compile-time static type checking based on registered definitions and rules. Such functionality would require compiler or tooling integration; registering a type does not automatically change Solidity's type system.
Type libraries should represent behavior intrinsic to the defined type. Project-specific business logic can be placed in separate libraries and potentially registered through future extensions.
Separating definitions, data, and behavior can make components easier to reuse and upgrade independently. Safe upgrades still require appropriate authorization, versioning, and compatibility checks.
Compatibility
ERC-1900 is designed as an additional application-layer mechanism rather than a change to existing Ethereum consensus rules or contract interfaces.
The historical Solidity examples use the experimental ABIEncoderV2 feature available at the time. ABI coder v2 became the default in Solidity 0.8.
The code excerpts are reproduced unchanged and have not been independently compiled or audited as part of this translation.
Citation
Loredana Cirstea (@loredanacirstea), Christian Tzurcanu (@ctzurcanu), "ERC-1900: dType - Decentralized Type System for EVM [DRAFT]," Ethereum Improvement Proposals, no. 1900, March 2019. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-1900.
Conclusion
ERC-1900 proposes a decentralized registry for reusable type definitions and associated ABI metadata. It provides a foundation for shared typed data and libraries across Ethereum applications.
Questions are welcome via Twitter @cardene777.
Other publications:



