Skip to content

CLI fails to parse private key with 0x prefix #422

@Radiiplus

Description

@Radiiplus

Description

The offckb deploy command fails to accept private keys with the standard 0x prefix.

Error

Error: Private key must be 32 bytes! at new SignerCkbPrivateKey(...)

Reproduction

# This fails even with valid 32-byte key
offckb deploy --network devnet --target ./my-contract --privkey 0x1234...abcd -y

# This works (manually stripped prefix)
offckb deploy --network devnet --target ./my-contract --privkey 1234...abcd -y

Expected Behavior

The CLI should accept private keys with or without the 0x prefix, as this is the standard format used in .env files and other CKB tooling.

Environment

  • offckb CLI version: latest
  • OS: Linux (WSL2)

Impact

Users must manually strip the 0x prefix before using the CLI, which is error-prone and inconsistent with other CKB tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions