> For the complete documentation index, see [llms.txt](https://argon-4.gitbook.io/argon-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://argon-4.gitbook.io/argon-docs/suresign/transactions.md).

# Transactions

How SureSign builds a Kaspa transaction: Note selection, change, mass and fee, inscriptions, packages, Igra carriers, and PSKT.

SureSign builds every transaction Enclave signs from a typed intent and a snapshot of the wallet's Notes. This page describes the rules it follows. All of them are enforced in the kernel; none can be changed from the interface.

## Consensus pin

Transaction types, script classes, mass calculation, sighash, and address encoding come directly from the reference Kaspa implementation, **rusty-kaspa `v2.0.1`** at commit `cfafeb4c`, compiled into the kernel as library crates. SureSign does not reimplement consensus; it uses the reference code and pins the version. Native transactions are version 1 on the native subnetwork, signed Schnorr with `SIG_HASH_ALL`.

## Notes and selection

A snapshot lists candidate Notes (UTXOs) with their outpoint, amount, script, DAA score, coinbase flag, frozen flag, covenant id if any, and local cluster. The kernel re-derives the script of every Note it intends to spend from the wallet's own keys and refuses any it cannot prove is its own. A coinbase Note younger than Kaspa's maturity is not selectable.

Automatic selection is privacy-first:

1. A single Note that covers the payment and fee.
2. Notes from a single cluster.
3. A merge across clusters, with a privacy finding on the plan.

Frozen Notes are never auto-selected. Manual selection is exact by default (**Strict**); **Preferred** lets the kernel add unfrozen Notes if the manual set is short. Where a plan would merge clusters and a single-cluster alternative exists, the kernel can offer a **private plan** and the interface lets the user switch to it.

## Change

Change goes to the next unused address on the account's change branch, derived by the kernel. A host cannot supply a change address, and a dApp cannot designate an output as change; the plan marks which change outputs the kernel derived and treats any other self-payment as an ordinary output. If the change would be dust, it is folded into the fee and the plan says so.

## Mass and fee

Kaspa prices transactions by **mass** under KIP-9: compute mass from size and signature operations, storage mass from the number and values of inputs and outputs, and transient mass. The minimum relay fee is a function of the greater of compute and transient mass, and a transaction must also stay under the storage-mass relay cap.

Fee and change interact: shrinking change raises storage mass, which raises the fee, which shrinks change. The kernel iterates to a fixed point and refuses if it cannot converge within a bounded number of rounds. When storage mass alone would exceed the cap, it may add a few more wallet inputs before giving up. Very small outputs are avoided because storage mass makes them expensive out of proportion to their value; the dust rule is the reference implementation's.

A user may set a fee floor above the minimum; the kernel never lets a fee be set below what the network requires, and the plan carries the fee and all three masses.

## Batch and sweep

A transfer may carry several payments in one transaction (a batch). The plan lists every recipient and raises a finding when there is more than one. **Send max** is a sweep: the kernel derives the payment from the selected Notes and fee, and the intent carries no amount.

## Inscriptions: commit and reveal

KRC-20, KRC-721, and KNS operations are inscriptions: a **commit** transaction pays to a P2SH script that embeds the operation, and a **reveal** spends it, exposing the script. SureSign plans both as one package, allocating only wallet-derived lots, paying the protocol's fee as the reveal's fee, and signing the reveal input explicitly against the P2SH script with the redeem wrapped in the signature script. Inscription Notes are shown frozen so an ordinary send cannot consume them, and an interrupted package resumes from its journal after unlock.

## Packages

An **action package** is one approval for an ordered set of transactions: fund a custody address, commit, reveal; or approve, then act, on Igra. The package hash commits to the intent, the slot graph, the custody addresses, the recipient, and the maximum KAS that may leave. Each slot is constructed only when the chain has made it legal, proven within bounds, signed, and checked against its own plan before release. See [The ReviewPlan → Packages](/argon-docs/suresign/review-plan.md#packages-one-approval-several-transactions).

## Igra carriers

Igra, Kaspa's EVM Layer, is reached only through Kaspa. Three carrier shapes exist:

| Carrier             | Purpose                                                                                                                    | Rules                                                                                                                                                                                 |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Payload carrier** | An Igra transaction (a contract call, a transfer) placed in a Kaspa transaction's payload for Igra's relayers              | The first output is the kernel's own: an Enclave fee when one applies, otherwise a 0.2 KAS self-payment that keeps storage mass under the relay cap; change follows.                  |
| **Bridge to Igra**  | A KAS payment to Igra's permissionless entry, credited 1:1 as iKAS; sized to what the package is short, never below 10 KAS | Only when iKAS and WiKAS cannot pay the package. First output is the entry lock and nothing else is added to it.                                                                      |
| **Custodial Entry** | KAS to Kat Bridge's vault, credited as iKAS                                                                                | Vault address, minimum (10 KAS), and 1 KAS fee to the pinned fee address are kernel facts; a vault the bridge's API reports is untrusted until it is on the plan. Refused on testnet. |

Igra calls are encoded by the kernel for a pinned set of contracts and functions (Kaskad, Lynx, Zealous Swap, WiKAS, INS, ERC-20 and ERC-721 transfers, Kat Bridge exits). The plan describes the call in words; the interface never assembles calldata. SureSign has no method for submitting to an Igra endpoint; every Igra transaction reaches Igra through Kaspa.

## PSKT

A partially signed Kaspa transaction from a dApp or another wallet is decoded whole into a plan. SureSign signs only the inputs the requester listed and the wallet controls, honors `SIG_HASH_ALL` only, and leaves every other input byte-for-byte unchanged. The plan shows the inputs it will sign, the inputs it will leave, and every output, so the user sees what they are joining. Nothing is broadcast from the PSKT path; the signed PSKT is returned to the requester.

## After signing

The signed transaction is decoded and compared with the approved plan. The kernel computes the transaction id locally and returns the bytes, the id, and a node-ready JSON form; the host broadcasts exactly those bytes, records the kernel's id against the Notes it spent, and the interface tracks acceptance and confirmations from the node under that id. The host never rebroadcasts a different transaction for the same approval.
