tx encodes and validates transfer-embodiment transactions.
Import path: github.com/co-mission/shyware/tx
Transaction envelope
All transfer transactions share the same envelope, aligned with the broader shyware runtime contract:Type is the wire-format discriminator. Signature authenticates the transaction
(operator ECDSA for admin txs; wallet ECDSA for user txs). Data is the type-specific payload.
Transaction types
| Constant | Value | Sender | Purpose |
|---|---|---|---|
TxTypeRegisterAsset | 1 | Operator | Register a new asset type |
TxTypeMint | 2 | Operator | Mint supply to an account |
TxTypeBurn | 3 | Operator | Burn supply from an account |
TxTypeTransfer | 4 | User | Anonymous transfer between accounts |
TxTypeRegisterAccount | 5 | User | Register an account commitment on-chain |
TxTypeRegisterValidator | 6 | Operator | Add or remove a consensus validator |
RegisterAssetData
AssetID is immutable after registration.
MintData / BurnData
TotalMinted and credits the account. Burn increases TotalBurned and debits
the account. Both enforce TotalSupply == TotalMinted - TotalBurned.
TransferData
The core transaction type. Implements the two-list invariant for anonymous transfers.TransferNonce→transfer_id = H(TransferNonce)→ stored in List 1 (TransferRecord)Nullifier = H(wallet_address, transfer_id)→ stored in List 2 (ParticipantRecord)
TODO(circuit) fields:
Amount is currently plaintext. SenderProof is reserved for the Pedersen range proof
that will prove balance >= amount without revealing either value. Until the circuit is built,
SenderProof may be omitted and the canonical runtime checks plaintext balances.
RegisterAccountData
WalletProof is an ECDSA
signature by the wallet private key over a canonical message (implementation-defined; see API docs).
The wallet address itself is never stored on-chain.
Encoding / decoding
Validate is stateless — it does not check balances, nullifier uniqueness, or
asset existence. Those checks happen in state.ExecuteTransfer during block
execution.