---
eip: 1319
label: ERC-1319
title: Smart Contract Package Registry Interface
status: Stagnant
type: Standards Track
category: ERC
created: 2018-08-13
official: https://eips.ethereum.org/EIPS/eip-1319
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1319.md
canonical: https://eips.huatuo.xyz/eip-1319/
lang: en
tldr: A common read/write interface for on-chain smart contract package registries, so tools like an Ethereum package manager could install versioned packages from any registry.
tags: [ethpm, packages, registry, tooling]
---

# ERC-1319: Smart Contract Package Registry Interface

> A standard interface for smart contract package registries.

**TL;DR:** A common read/write interface for on-chain smart contract package registries, so tools like an Ethereum package manager could install versioned packages from any registry.

## What problem does it solve?

Developers reuse libraries like `Ownable` or token templates the way web developers use npm. The EthPM project ran a single, centralised package registry. The authors wanted many independent registries (each possibly named via ENS, e.g. `packages.zeppelin.eth`) that tooling could query the same way.

ERC-1319 defines that minimal common interface. Each registry can have its own business logic (who may publish, fees, etc.) but exposes the same endpoints, so a CLI or library can resolve "package X version Y" against any of them.

## How it works

The data model:

- A **registry** contract holds many **packages**.
- A **package** has a unique name and `bytes32` package id, and a list of **releases**.
- A **release** is identified by a `bytes32` release id, unique per (name, version). It points to a **manifest URI**: a content-addressed location (IPFS, Swarm, or similar) of a package manifest as defined in [EIP-1123](/eip-1123/).

Semver is suggested but not required; versions are just strings.

**Write API** (one method):

```solidity
function release(string packageName, string version, string manifestURI) returns (bytes32 releaseId);
event VersionRelease(string packageName, string version, string manifestURI);
```

**Read API**: `getAllPackageIds(offset, limit)`, `getPackageName(id)`, `getReleaseId(name, version)`, `getAllReleaseIds(name, offset, limit)`, `getReleaseData(releaseId)`, `generateReleaseId(name, version)`, `numPackageIds()`, `numReleaseIds(name)`.

The list methods are paginated: they return a `pointer` to continue from, because the lists can grow too large for one call. `generateReleaseId` must be public so tools can compute the id for a (name, version) pair without listing every release.

## Sample code

The release-id scheme suggested in the spec:

```solidity
function generateReleaseId(string memory packageName, string memory version)
    public pure returns (bytes32)
{
    return keccak256(abi.encodePacked(packageName, version));
}
```

Resolving a release with ethers v6:

```ts
import { Contract, JsonRpcProvider } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const registry = new Contract(registryAddress, [
  "function getReleaseId(string packageName, string version) view returns (bytes32)",
  "function getReleaseData(bytes32 releaseId) view returns (string packageName, string version, string manifestURI)",
], provider);

const id = await registry.getReleaseId("simple-token", "1.0.1");
const { manifestURI } = await registry.getReleaseData(id);
console.log(manifestURI); // e.g. an ipfs:// URI to fetch the package manifest
```

## Things to know

- Status is **Stagnant**. The companion manifest spec [EIP-1123](/eip-1123/) is Withdrawn, and EthPM tooling is no longer widely used.
- The registry stores only pointers. Integrity comes from the manifest URI being content-addressed, so always verify the fetched content matches its hash.
- The spec recommends registries also implement [ERC-165](/eip-165/) to advertise richer interfaces (semver ranges, `latest`, etc.), which this standard deliberately leaves out.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-1319
