Todas as lições · Wallets and signing · Começa aqui · Glossário
Proving control of any CKB lock by running the lock on a signed unsent template transactionPráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 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.
Porque importa: 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.
Padrão
signer.signOnlyTransaction(await signer.prepareTransaction(ccc.Transaction.from(template)))Tirado do commit, encurtado.
- Conceitos
- Witnesses and signatures, Login and authorization
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-11-21
- Última mudança
- 2026-11-21
- Última verificação
- 2026-11-23
- Verificação contra o commit
- certa: a lição sai do commit e continua a valer no código de hoje
Fontes (1)
- 2026-11-21 · LusoCryptoLabs/ckb-ward · mais deste projeto
Mais sobre 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
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
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.