@cardinal/creator-standard

中文文档
3.0.2发布于 2023/02/14AGPL-3.0ESM + CJS近 30 天下载 2674

SDK for cardinal-creator-standard

原始使用文档
文档目录3 节
  1. Read the GitBook
  2. Ruleset
  3. Mint Manager

Cardinal Creator Standard

Read the GitBook

Contains the entire end-to-end proposal that includes background, proposed solution, pricing and examples of technical integration.

Background

The Creator Standard is a smart contract-level solution to the issue of royalty circumvention that allows creators to decide with which programs their NFTs can interact without sacrificing basic wallet-to-wallet transfers.

The protocol, which is built on top of the SPL token program, selectively permissions token transfers to achieve this. Every token has an associated Mint Manager account, which holds its freeze and mint authority. Each mint manager specifies a ruleset, which is simply a set of "rules" (allowlist/denylist) that dictates which programs can interact with and transfer the NFT. The ruleset is assigned by the NFT's creator and can be updated at their discretion.

Basic NFT

NFT with Attached Ruleset

NFT Ruleset Program Interaction

Rulesets Can Be 1:Many with NFTs

Rulesets Can Extend Other Rulesets

Program State

The program utilizes two types of program derived accounts.

Ruleset

📖 Set of rules that permission the transfer of a token specified by the token’s creator
let mut seeds = ['ruleset'.as_bytes(), name.as_bytes()];
pub struct Ruleset {
    // account discriminator
    pub account_type: u8,
    // version for potential future versioning
    pub version: u8,
    // authority who can update this ruleset
    pub authority: Pubkey,
    // name for this ruleset (also used to derive ruleset address)
    pub name: String,
    // vector of allowed programs that can interact with this nft
    pub allowed_programs: Vec<Pubkey>,
    // vector of disallowed addresses that cannot interact with this nft
    pub disallowed_addresses: Vec<Pubkey>,
}

Mint Manager

📖 One-to-one relationship with a token’s mint. A token minted implementing CCS has a respective mint manager that holds its mint and freeze authority. An already existing toke can implement CSS by surrendering its aforementioned authorities.
let mut seeds = ['mint-manager'.as_bytes(), mint.as_ref()];
pub struct MintManager {
  // account discriminator
  pub account_type: u8,
  // version for potential future versioning
  pub version: u8,
  // mint address of this NFT that this mint-manager corresponds to
  pub mint: Pubkey,
  // authority who can update the ruleset of this mint-manager
  pub authority: Pubkey,
  // ruleset to be checked when transferring
  pub ruleset: Pubkey,
  // optional address currently using this NFT meaning it cannot be transferred while in-use
  pub in_use_by: Option<Pubkey>,
}

When a mint manager gets created for a mint, the mint manager freezes the mint perpetually. Each mint manager is associated with a ruleset, with it specifying specific a set of rules

Most fields are self-explanatory with the exception of in_use_by field which needs some underlying context and will be discussed below.

版本与发布记录

@cardinal/creator-standard 共发布 50 个版本,首次发布于 2022/11/10;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.0.2latest2023/02/143 年前
3.0.12023/02/143 年前
3.0.02023/02/143 年前
2.4.02023/02/103 年前
2.4.0-beta.2beta2023/02/093 年前
2.4.0-beta.12023/02/093 年前

关于 @cardinal/creator-standard 的常见问题

@cardinal/creator-standard 是什么?

SDK for cardinal-creator-standard

如何安装 @cardinal/creator-standard?

在项目目录运行 npm install @cardinal/creator-standard,或使用 pnpm add / yarn add / bun add。

@cardinal/creator-standard 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cardinal__creator-standard 是否存在。

@cardinal/creator-standard 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@cardinal/creator-standard 可以商用吗?

@cardinal/creator-standard 使用 AGPL-3.0 许可。最严格的 Copyleft:除分发外,通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括,不构成法律意见,请以许可原文为准。

@cardinal/creator-standard 的下载量有多少?

根据 npm 官方下载统计,@cardinal/creator-standard 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,674 次,日均约 89 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cardinal/creator-standard 还在维护吗?

最新版本 3.0.2 发布于 2023/02/14(3 年前);至今共发布 50 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/11/10。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。