CKB Pulse

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

Use JsonRpcTransformers.transactionFrom to serialize CCC transactions for CKB/Fiber RPCWorkingReproduced

Reproduced · Check: right · Checked 2026-11-19

Serializing a ccc.Transaction with ccc.stringify keeps cached input fields (cellOutput, outputData) that a native RPC such as Fiber submitSignedFundingTx does not expect. JsonRpcTransformers.transactionFrom from @ckb-ccc/core/advanced emits snake_case hex with inputs containing only previous_output and since, while keeping the tx hash and witnesses unchanged, as the commit's tests check.

Why it matters: Serializing with ccc.stringify sends cached input metadata (cellOutput, outputData) in a non-RPC shape to the native Fiber node's submitSignedFundingTx. The commit's tests show the RPC form must carry only previous_output and since per input, with the hash and witnesses intact.

Pattern

Prefer
return JsonRpcTransformers.transactionFrom(transactionLike as ccc.TransactionLike);

Taken from the commit, shortened.

A test changed in the same commit

It sits next to the fix. We did not run it.

Reproduced by a test

A public test runs what this lesson says on @ckb-ccc/core 1.23.1, with no node. Anyone can run it.

tests/ccc/serialize-for-rpc.test.mjs

Concepts
Data encoding (molecule, hex, bigints), Transaction building and fees
Evidence
Reproduced: reproduced by a public test
First seen
2026-09-28
Last changed
2026-09-28
Last checked
2026-11-19
Check against the commit
right: the lesson follows from its commit and still holds in the code today

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, "Use JsonRpcTransformers.transactionFrom to serialize CCC transactions for CKB/Fiber RPC", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/use-jsonrpctransformers-transactionfrom-to-serialize-ccc-tra, CC BY 4.0, last changed 2026-09-28.

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.