Merge a Cardano browser wallet’s partial witness set
A CIP-30 wallet can add only the signatures it controls to a transaction requiring several parties. Its return value is a serialized witness set.
Keep the original transaction body
Pass the transaction CBOR to the enabled wallet API and request partial signing when external signers are expected. Decode the returned witness set using a ledger-aware library and merge compatible witnesses into the original transaction.
const witnessCbor = await api.signTx(unsignedTxCbor, true)
If the transaction needs keys A and B and the wallet controls A, a valid partial result can contain A’s signature only. Preserve previously supplied scripts, redeemers and other witnesses. Verify key signatures against the unchanged body hash.
Detect incomplete signatures before submission
Determine the required witnesses from the actual inputs, certificates and other transaction purposes. A resolved wallet promise alone does not establish completeness. Changing fee, outputs or validity interval after signing changes the body and requires new signatures. cips.cardano.org Cardano CIP-30