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
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.
- toastmanAu/openswap:
frontend/test/activity.spec.ts,frontend/test/app.spec.ts,frontend/test/book.spec.ts,frontend/test/fixtures.ts,pool-model/test/model.test.ts
- 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)
- 2026-10-22 · toastmanAu/openswap · more from this project
More about Wallets and signing
- JoyID signer prices fees with a 1,000 byte signature placeholder
- Multisig sighash placeholder lock: script plus M zeroed signatures
- One placeholder witness per input when all inputs share one lock
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.