CKB Pulse

All lessons · Wallets and signing · Start here · Glossary

JoyID lock witness outputType may carry a subkey proof, so type script data must move elsewhereWorkingFrom one fix

From one fix · Check: right · Checked 2026-11-19

When the funding wallet uses the JoyID lock, its WitnessArgs outputType may carry a subkey unlock proof, so do not put your own type script data in that witness's outputType. Place the type script action in another witness index and align the related output index with it. Size the fee estimate's signature placeholder for JoyID's larger witness (openswap uses 1000 bytes) instead of the 65 byte secp256k1 size.

Why it matters: A JoyID subkey proof and the type script action would collide in the same outputType field, and a 65 byte placeholder underestimates the fee for the much larger JoyID witness.

Pattern

Prefer
const stateIndex=wallet.witness?.kind==='joyid'?1n:0n;

Taken from the commit, shortened.

A test changed in the same commit

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

Concepts
Witnesses and signatures, Transaction building and fees
Evidence
From one fix: from one project, checked against its commit
First seen
2026-10-22
Last changed
2026-10-22
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 Wallets and signing

All 23 in this topic

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

Cite this lesson
LusoCryptoLabs, "JoyID lock witness outputType may carry a subkey proof, so type script data must move elsewhere", CKB lessons, https://pulse.lusocryptolabs.com/learned/wallets/joyid-lock-witness-outputtype-may-carry-a-subkey-proof-so-ty, CC BY 4.0, last changed 2026-10-22.

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.