Skip to main content
Spore Protocol is CKB’s native NFT standard. Unlike most NFT systems, Spore stores all content — images, text, binary data — directly inside CKB cells. There is no IPFS link or external server that can go offline. Burning (melting) a Spore releases the stored CKB capacity back to the owner.

Installation

Import

The package re-exports the full ccc namespace and adds Spore-specific functions.

Create a Spore

Use createSpore() to mint a new NFT. Pass a SporeDataView that describes the content type and raw content bytes.
createSpore() returns:
  • tx — a transaction skeleton with the Spore output and required cell deps. You must call completeInputsByCapacity(signer) and completeFeeBy(signer) before broadcasting.
  • id — the unique spore ID (a hex string) that identifies this NFT permanently on-chain.

SporeDataView fields

createSpore parameters

Cluster modes

When a Spore includes a clusterId, CCC must prove that the signer has permission to add a Spore to the cluster. The clusterMode parameter controls how this is done.
Puts the cluster cell itself into the transaction inputs and outputs. Use this for private clusters where you own the cluster cell directly.
Does not add any cluster-related inputs or outputs. Use only when you have already handled the cluster logic manually, or for testing.
If clusterId is set in the Spore data and clusterMode is not provided, createSpore() throws an error. Always specify a clusterMode when using clusters.

Transfer a Spore

Call transferSpore() to change the owner of a Spore. The transaction moves the Spore cell from the current owner’s lock to the recipient’s lock.

transferSpore parameters

Melt a Spore

Melting destroys a Spore permanently and releases the CKB capacity locked inside back to the signer’s address.
Melting is irreversible. The Spore and all its on-chain content are permanently destroyed. The reclaimed CKB capacity is returned to the signer.

Query Spores

Find Spores owned by the signer

findSporesBySigner() is an async generator that yields all Spores controlled by the connected wallet. Optionally filter by cluster ID.
Filter to a specific cluster:

Find Spores by lock or cluster

findSpores() searches by lock script and optional cluster ID. Use it when you want to query spores for an arbitrary address rather than the connected signer.

findSpores parameters

Complete example

create-and-send-spore.ts

Next steps

UDT Tokens

Work with fungible tokens on CKB using the UDT package.

Send CKB

Review the core transaction building primitives CCC uses under the hood.