全部经验 · Wallets and signing · 从这里开始 · 术语表
Proving control of any CKB lock by running the lock on a signed unsent template transaction实践来自一次修复
来自一次修复 · 核对结果:正确 · 核对于 2026-11-23
To prove a user controls any CKB lock that signs the transaction hash, have the wallet sign an unsent template transaction whose input carries that lock and whose content binds the login message. That input is a constructed outpoint, so the transaction can never be committed. In CCC this is signer.signOnlyTransaction(await signer.prepareTransaction(tx)). The backend then rebuilds the template from the lock and message, reads the lock's cell deps live from the chain, and runs the lock in CKB-VM with ckb-script. This works for secp256k1, multisig, anyone-can-pay, PW-lock, Nostr and Omnilock EVM, BTC or Dogecoin signers without moving anything on chain.
为什么重要: Checking a signed message per wallet type only covers the signature schemes you hand-code, while running the real lock on a signed template accepts every lock that signs the transaction hash and refuses wrong keys or flipped signatures exactly as the chain would.
The base already has hardening rules for lock based sign in proofs (live deps, empty witness probe, fake inputs), but none teaching the core technique of signing an unsent template transaction and running the lock off chain.
代码模式
signer.signOnlyTransaction(await signer.prepareTransaction(ccc.Transaction.from(template)))摘自提交,已缩短。
- 概念
- Witnesses and signatures, Login and authorization
- 证据
- 来自一次修复: 来自一个项目,已对照其提交核对
- 首次出现
- 2026-11-21
- 最近改动
- 2026-11-21
- 最近核对
- 2026-11-23
- 对照提交的核对结果
- 正确:这条经验出自该提交,并且在今天的代码中仍然成立
来源(1)
- 2026-11-21 · LusoCryptoLabs/ckb-ward · 这个项目的更多经验
更多关于Wallets and signing
- JoyID sub key membership is checked through the CoTA aggregator
- EVM owners may hold Omnilock lock args with auth flag 0x12, not only 0x01
- Binding an off-chain lock proof to the live cell deps it ran with
引用这条经验
LusoCryptoLabs, "Proving control of any CKB lock by running the lock on a signed unsent template transaction", CKB lessons, https://pulse.lusocryptolabs.com/learned/wallets/proving-control-of-any-ckb-lock-by-running-the-lock-on-a-sig, CC BY 4.0, last changed 2026-11-21.