Skip to main content

CKB Auth

A consolidated library featuring numerous blockchains authentication techniques on CKB-VM. We also write a repository to demonstrate how to use this library: ckb-auth-example.

CKB Auth uses Exec or Dynamic Library at the low level to support cross-module calls. The high-level interface currently supports C and Rust (other languages can also interact via CKB Syscalls, but the implementation is more complex).

The following blockchains are supported:

How It Works

Signature verification requires the following four parameters:

  • Algorithm ID: Identifies the signature algorithm, 1 byte.
  • Public key hash: Can be a hash (e.g., blake160) of a public key, a preimage, or other data. blake160 refers to the first 20 bytes of a blake2b hash.
  • Signature data: Variable-length signature data.
  • Message: The message to be verified.

These parameters must be provided to CKB Auth by the developer. Typically, Algorithm ID and Public key hash are combined into 21 bytes and stored in Args; Signature data is passed through the witness; and the Message is generated by hashing tx_hash together with Witnesses (resulting in 32 bytes). See: generate_sighash_all.

More details in auth.md.

Deployment

None