secp256k1_blake160_sighash_all(lock)约束secp256k1_blake160_sighash_all (lock) Constraints
来源:ckb-system-scripts / c/secp256k1_blake160_sighash_all.c + c/common.h · code_hash 0x9bd7…cce8,hash_type type(RFC 0024)Source: ckb-system-scripts / c/secp256k1_blake160_sighash_all.c + c/common.h · code_hash 0x9bd7…cce8, hash_type type (RFC 0024)
1 → N解锁花费Unlock & spend
Inputs 输入Inputs
input(同一 lock 的 script group)input (script group of the same lock)Cell{
lock: { codeHash: SECP256K1_BLAKE160,
args: blake160(pubkey) 20B }
}
witness[group 第 1 个 input 的位置]witness[at the group's first input index]WitnessArgs{
lock: signature 65B
}
// 签名时 lock 置为 65 字节 0WitnessArgs{
lock: signature 65B
}
// lock is zero-filled (65B) while signing
➜
Outputs 输出Outputs
outputs:任意 celloutputs: any cellsCell{
lock: 任意,
type: 任意
}Cell{
lock: any,
type: any
}
witness.lock 字节布局witness.lock byte layout
r‖s64B
recid1B
- r‖s 64B secp256k1 紧凑签名secp256k1 compact signature 可解析parsable (-14)
- recid 1B 恢复 id(lock[64])recovery id (lock[64]) 可恢复公钥 / 可序列化pubkey recoverable / serializable (-11 / -15)
限制Constraints
- args:: 恰为 20 字节exactly 20 bytes (-1)
- witness ≤ 32KB≤ 32KB (-22)
- witness:: 合法 WitnessArgs 且 lock 非空valid WitnessArgs with non-empty lock (-2)
- witness.lock:: 恰为 65 字节exactly 65 bytes (-1)
- 签名signature:: 恢复出的 blake160(压缩公钥) = argsrecovered blake160(compressed pubkey) = args (-31)
部署与来源Deployments & source 未核验unverified
源码source nervosnetwork/ckb-system-scripts@72eb92fc · c/secp256k1_blake160_sighash_all.c · c/common.h (default-branch HEAD recorded at backfill 2026-10-21; spec/plugin were written from the default branch shortly before (exact read commit not recorded))
二进制核验binary check 未核验unverified no binary or checksum at the recorded commit matched the deployed data hash (reproducible build not attempted)
| 网络network | code_hash | cell_dep | type_id args | 数据哈希data hash | 部署交易deploy tx |
|---|---|---|---|---|---|
| mainnet | 0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8 type | 0x71a7ba8fc9…8172e46c:0 dep_group | 0x8536c9d5d9…6f71c304 | 0x709f3fda12…cce08649 | 0xe2fb199810…6d73ff5c #0 |
| testnet | 0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8 type | 0xf8de3bb47d…4aee5d37:0 dep_group | 0x8536c9d5d9…6f71c304 | 0x709f3fda12…cce08649 | 0x8f8c79eb66…42635c9f #0 |
链上数据核对于 on-chain data checked 2026-10-20
签名消息 = blake2b(tx_hash ‖ len(w0) ‖ w0(lock 置 0) ‖ 本 group 其余 witness 的 len‖内容 ‖ 超出 inputs 数量部分的 witness 的 len‖内容);len 为 u64 LEsigning message = blake2b(tx_hash ‖ len(w0) ‖ w0 (lock zeroed) ‖ len‖content of the group's other witnesses ‖ len‖content of witnesses beyond the inputs count); len is u64 LE
其他错误码:-3 ERROR_SYSCALL,-21 ERROR_SCRIPT_TOO_LONGOther error codes: -3 ERROR_SYSCALL, -21 ERROR_SCRIPT_TOO_LONG
其他错误码:-3 ERROR_SYSCALL,-21 ERROR_SCRIPT_TOO_LONGOther error codes: -3 ERROR_SYSCALL, -21 ERROR_SCRIPT_TOO_LONG