ethPM
  • Introduction
  • ethPM Specification
  • ERC1319: Package Registry Standard
  • URIs
  • ethPM Registry Directory
  • ethPM Developer Guide
    • ethPM & Remix IDE
    • Getting Started with ethPM CLI
    • ethPM & Etherscan Verified Contracts
    • Compound Finance & ethPM
    • ethPM Library Support
    • FAQs
Powered by GitBook
On this page

Was this helpful?

URIs

PreviousERC1319: Package Registry StandardNextethPM Registry Directory

Last updated 5 years ago

Was this helpful?

ethPM uses a variety of URI schemes to help identify specific resources.

Content-Addressed URIs

Content-addressed URIs are used to ensure the immutability of each package release. A content-addressed URI is any URI that contains a cryptographic hash ensuring the identity of its contents and that the contents have not been modified. For example...

    • ipfs://Qme4otpS88NV8yQi8TfTP89EsQC5bko3F5N1yhRoi6cwGV

    • bzz://2477cc8584cc61091b5cc084cdcdb45bf3c6210c263b0143f030cf7d750e894d

    • https://api.github.com/repos/:owner/:repo/git/blobs/:file_sha

Registry URIs

A registry URI is used to specify an on-chain registry or a specific release on a registry. Registry URIs may use the scheme ethpm or erc1319. All versions in a Registry URI must properly escape all URL reserved characters. CHAIN_ID is optional - and if not included, defaults to 1 (eg. mainnet).

ethpm://[CONTRACT_ADDRESS]:[CHAIN_ID]

  • ex: ethpm://0x6b5DA3cA4286Baa7fBaf64EEEE1834C7d430B729:1

ethpm://[CONTRACT_ADDRESS]:[CHAIN_ID]/[PACKAGE_NAME]@[PACKAGE_VERSION]

  • ex:ethpm://0x6b5DA3cA4286Baa7fBaf64EEEE1834C7d430B729:1/owned@1.0.0

Blockchain URIs

  • blockchain://[CHAIN_ID]/block/[BLOCK_HASH]

    • CHAIN_ID is the unprefixed hexadecimal representation of the genesis hash for the chain.

    • BLOCK_HASH is the unprefixed hexadecimal representation of the hash of a block on the chain.

Etherscan URIs

ethPM CLI uses this URI scheme to automatically generate packages for any of Etherscan's verified contracts. The provided contract address and chain ID must correspond to a contract address that has been verified (hint. look for the green checkmark in the Contract tab).

etherscan://[CONTRACT_ADDRESS]:[CHAIN_ID]

  • ex: etherscan://0xdAC17F958D2ee523a2206206994597C13D831ec7:1

A blockchain URI is used to specify the blockchain on which a deployed contract instance lives. This definition originates from .

IPFS
Swarm
Git Blobs
BIP122 URI