Getting Started with UCAN

This guide will walk you through the basics of implementing UCAN (User Controlled Authorization Network) in your applications.

What is UCAN?

UCAN is a trustless, secure, local-first, user-originated authorization scheme. It provides public-key verifiable, delegable, and openly extensible capabilities without requiring centralized servers or sharing cryptographic keys.

Core Concepts

Capabilities

UCANs represent capabilities - specific permissions that can be delegated to others. Each capability defines what actions can be performed on which resources.

Delegation

Delegation provides a way to "transfer authority without transferring cryptographic keys". Users can delegate capabilities to others with constraints like time limits, reduced scope, and policy conditions.

Invocation

An invocation expresses the intention to execute a delegated capability. It contains all the authority needed to perform a task, plus the command to actually do it.

Quick Start

1 Choose Your Library

Select a UCAN library for your programming language. We have official implementations for JavaScript, Rust, and Go.

Browse Libraries

2 Create Your First UCAN

Define a capability schema and delegate it to another identity.

// Define a capability with a command and schema
import { Capability } from "iso-ucan/capability"
import { EdDSASigner } from "iso-signatures/signers/eddsa.js"
import { z } from "zod"

const FileCap = Capability.from({
  schema: z.object({ path: z.string() }),
  cmd: "/file/read"
})

const alice = await EdDSASigner.generate()
const bob = await EdDSASigner.generate()

const delegation = await FileCap.delegate({
  iss: alice,    // issuer
  aud: bob,     // audience
  sub: alice,   // subject (resource owner)
  pol: [],      // policy constraints
  exp: Math.floor(Date.now() / 1000) + 3600
})

3 Delegate and Invoke

Delegate capabilities to other users and create invocations to exercise those capabilities.

See Examples

Ready to Dive Deeper?

Explore the full specification to understand all of UCAN's capabilities and implementation details.