CKB Pulse
Lessons

What CKB learned

Start here · Glossary · Test yourself · Feed

xUDT and tokens

2 lessons found. All lessons

Carry type script and data into the output when spending a lock-only custody cellWorkingFrom one fix

When a custom lock's spend rebuilds an output from an input cell that may carry a type script (a UDT held in custody, say), copy cell.cellOutput.type and cell.outputData into the output and change only the lock; writing outputsData "0x" with no type burns or strands the token. Add the type script's cell deps to the transaction before signing, because the signature covers the cell deps and callers cannot append them afterwards, and refuse to build the spend if a typed cell comes without them. If the lock also constrains who gets the capacity (as Tranfr's recipient claim does today), follow that rule instead of a plain copy.

#Transaction building and fees #Cell deps and script lookup #Witnesses and signatures · Sources (1) · 2026-10-21

Full-balance UDT burn is valid for SUDT and plain xUDTWorkingFrom one fix

Burning a UDT's entire balance is accepted by SUDT and xUDT without extensions, because those scripts allow output amount to be less than or equal to input amount. offckb removed a guard that rejected destroyAmount === totalBalance and now still emits a zero-balance type cell (16-byte zero amount), which is valid. Extension-enabled xUDT was not covered by this change.

#Transaction building and fees #Capacity and cell size · Sources (1) · 2026-10-08

Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. JSON · Want a lesson changed or removed? Open an issue.