Purpose
Thepackages/ directory contains standalone libraries that:
- Can be used independently in your projects
- Follow semantic versioning and maintain changelogs
- Are properly licensed (Apache 2.0)
- Depend only on other published packages or code within the packages directory
- Are maintained by designated teams in the IC codebase
Packages in this directory can depend on one another and other published code, but not on any other code in the IC repository.
Categories
Testing Tools
- PocketIC - A comprehensive canister testing library for Rust that provides a local testing environment for Internet Computer smart contracts
ICRC Token Standards
- ICRC Ledger Types - Type definitions for the ICRC-1 fungible token standard
- ICRC Ledger Client - Client library for interacting with ICRC-1 ledgers from canister code
- ICRC Ledger Agent - Agent library for interacting with ICRC-1 ledgers from applications
- ICRC Ledger Client CDK - CDK-specific utilities for ICRC-1 ledger interactions
- ICRC CBOR - CBOR encoding/decoding support for ICRC types
Cryptography
- ic-ed25519 - Ed25519 signature creation and verification
- ic-secp256k1 - ECDSA and Schnorr signatures over secp256k1
- ic-secp256r1 - ECDSA signatures over secp256r1 (P-256)
- ic-sha3 - SHA-3 and Keccak hashing utilities
- ic-signature-verification - Multi-signature verification utilities including canister signatures
- ic-pub-key - Public key handling utilities
- ic-hpke - Hybrid Public Key Encryption (HPKE) implementation
Core Utilities
- ic-error-types - Common error types used across IC packages
- ic-http-types - HTTP request/response types for the IC
- ic-ethereum-types - Ethereum-compatible type definitions
- ic-ledger-hash-of - Hashing utilities for ledger operations
- ic-heap-bytes - Memory-efficient byte handling
- ic-heap-bytes-derive - Derive macros for heap byte utilities
- ic-metrics-assert - Testing utilities for metrics
- ic-dummy-getrandom-for-wasm - Random number generation polyfill for WASM
Logging
- canlog - Structured logging for canisters
- canlog_derive - Derive macros for canlog
Installation
Rust Crates
Add packages to yourCargo.toml:
cargo add:
Package Guidelines
All packages in this directory follow these standards:Has a LICENSE file (Apache 2.0)
Has a comprehensive README.md
Maintains a CHANGELOG.md following Keep a Changelog
Has team ownership defined in CODEOWNERS
Team ownership of package name in the registry
Documentation
Each package provides:- README - Quick start and basic usage
- API Documentation - Published on docs.rs for Rust crates
- Examples - Sample code and integration tests
- Changelog - Version history and migration guides
Contributing
To contribute to these packages:- Follow the package guidelines listed above
- Ensure your changes maintain backward compatibility or follow semantic versioning
- Update the changelog with your changes
- Add tests for new functionality
- Update documentation as needed
Repository
All packages are maintained in the main Internet Computer repository:- GitHub: dfinity/ic
- Packages Directory:
packages/
Support
For questions and support:- Join the discussion on the DFINITY Forum
- Check package-specific documentation on docs.rs
- Review examples in the repository