CKB Pulse

All lessons · CCC (TypeScript SDK) · Start here · Glossary

Sign a prepared transaction without broadcasting via CCC signOnlyTransactionWorkingFrom one fix

From one fix · Check: partly right · Checked 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).

Why it matters: Without this, the wallet could switch accounts during signing or return an altered transaction, and the app would accept a signature it never checked.

Pattern

Prefer
const signed=await signer.signOnlyTransaction(c.Transaction.fromBytes(req.transaction));

Taken from the commit, shortened.

Concepts
Witnesses and signatures, Transaction building and fees
Evidence
From one fix: from one project, checked against its commit
First seen
2026-11-09
Last changed
2026-11-09
Last checked
2026-11-19
Check against the commit
partly right: a true core, with a part that is loose or too wide

Sources (1)

More about CCC (TypeScript SDK)

All 33 in this topic

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
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.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.