CKB Pulse

Todas as lições · Apps and UI · Começa aqui · Glossário

Witness data in input_type and folding sub-minimum changePráticoDe uma correção

De uma correção · Verificação: em parte certa · Verificada em 2026-11-19

Put the type script's witness data in WitnessArgs.input_type of each input it guards (the type script reads the first witness of its own input group), so the lock field stays free for the wallet's signature and one signature can cover several such inputs. If the change left after a fixed fee is below a plain cell's minimum occupied capacity, add it to an existing output whose scripts accept extra capacity; if there is no such output, refuse the build instead of creating a cell that cannot exist.

Porque importa: If the type script's data sat in the lock field, the wallet's signature would overwrite it or clash with it, and one wallet could not sign a transaction that retires several tickets at once.

Padrão

witnesses: inputs.map(() => WitnessArgs{inputType: data}); if (rest < plainFloor) outputs[0].capacity += rest

Um teste mudou no mesmo commit

Está ao lado da correcção. Nós não o corremos.

Conceitos
Witnesses and signatures, Transaction building and fees, Capacity and cell size
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-11-14
Última mudança
2026-11-14
Última verificação
2026-11-19
Verificação contra o commit
em parte certa: um núcleo verdadeiro, com uma parte solta ou demasiado larga

Fontes (1)

Mais sobre Apps and UI

Ver as 9 deste tema

Manténs um projeto de onde esta lição veio? Confirma ou corrige

Citar esta lição
LusoCryptoLabs, "Witness data in input_type and folding sub-minimum change", CKB lessons, https://pulse.lusocryptolabs.com/learned/apps/witness-data-in-input-type-and-folding-sub-minimum-change, CC BY 4.0, last changed 2026-11-14.

Tiradas de commits públicos e verificadas contra o commit de onde cada uma veio e o código de hoje do projeto. Lê a fonte antes de confiar numa. Texto sob CC BY 4.0: dá crédito à LusoCryptoLabs, CKB lessons, com uma ligação para a lição. Queres que uma lição seja mudada ou retirada? Abre um issue.