Overview


Welcome to the official documentation for OCAP Libraries, a comprehensive suite for building applications with decentralized identity. This guide provides everything you need to integrate powerful, self-sovereign identity features into your applications. At the core are three main packages: @arcblock/did, @ocap/wallet, and @ocap/util. Together, they provide a complete toolset for creating, managing, and utilizing DIDs in a decentralized environment.

@arcblock/did#

The @arcblock/did library is a JavaScript implementation for working with ArcBlock DIDs, fully compliant with the ArcBlock DID specification. It provides the essential functions to create and validate DIDs from various inputs like public or private keys.

@ocap/wallet#

The @ocap/wallet library provides utility functions to create and manage DID-compatible cryptographic wallets. A wallet holds the cryptographic keys (public and secret) that are the foundation of a decentralized identity. It handles core operations like signing messages and verifying signatures, which are essential for proving ownership and authorizing actions in a decentralized system.

@ocap/util#

The @ocap/util library serves as a foundational toolkit, providing shared utility functions used across multiple OCAP libraries. It includes essential helpers for data type conversion, encoding (like Base58 and Hex), and other low-level operations that both @arcblock/did and @ocap/wallet rely on to function correctly.

How They Work Together#

While these libraries can be used independently, they are designed to work seamlessly together. The typical workflow involves using @ocap/wallet to manage the cryptographic keys and then passing those keys to @arcblock/did to generate the corresponding DID address. The wallet secures the 'who' (the keys), while the DID library creates the 'what' (the public identifier).


What's Next?#

Ready to dive in? Here are some starting points: