Todas as lições · CCC (TypeScript SDK) · Começa aqui · Glossário
Sign a prepared transaction without broadcasting via CCC signOnlyTransactionPráticoDe uma correção
De uma correção · Verificação: em parte certa · Verificada em 2026-11-19
signer.signOnlyTransaction(tx) asks the CCC signer to sign a transaction you already completed (inputs, fee, cell deps, zero placeholder witness) without preparing or sending it. Treat the wallet as untrusted: pass it a copy, recheck the connected account after it returns, and verify the signed result against the sign hash you got from tx.getSignHashInfo(lock, client) on the prepared transaction (same tx hash, other witnesses untouched, signature recovers to the expected public key).
Porque importa: Without this, the wallet could switch accounts during signing or return an altered transaction, and the app would accept a signature it never checked.
Padrão
const signed=await signer.signOnlyTransaction(c.Transaction.fromBytes(req.transaction));Tirado do commit, encurtado.
- Conceitos
- Witnesses and signatures, Transaction building and fees
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-11-09
- Última mudança
- 2026-11-09
- Última verificação
- 2026-11-19
- Verificação contra o commit
- em parte certa: um núcleo verdadeiro, com uma parte solta ou demasiado larga
Fontes (1)
- 2026-11-09 · Ticoworld/QuotaCell · mais deste projeto
Mais sobre CCC (TypeScript SDK)
- Reserve co-signer witness space before completeFeeBy in multi-signer CCC transactions
- Sign each lock group with its own placeholder length and witness shape
- completeFeeBy adds change instead of shrinking outputs, breaking output bound proofs
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Sign a prepared transaction without broadcasting via CCC signOnlyTransaction", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/sign-a-prepared-transaction-without-broadcasting-via-ccc-sig, CC BY 4.0, last changed 2026-11-09.