Skip to main content

TransactionType

Enum TransactionType 

Source
pub enum TransactionType {
Show 25 variants Transfer { amount: u128, }, ContractDeploy { code: Vec<u8>, args: Vec<u8>, }, ContractCall { function: String, args: Vec<u8>, }, AgentRegister { config: Vec<u8>, }, AgentExecute { task: Vec<u8>, }, ModelInference { model_id: String, input: Vec<u8>, }, TeeProviderRegister { attestation: Vec<u8>, info: Vec<u8>, }, ProviderStake { amount: u128, provider_type: String, }, ProviderUnstake { amount: u128, }, GovernancePropose { proposal: Vec<u8>, }, GovernanceVote { proposal_id: String, vote: bool, }, BridgeTransfer { target_chain: String, target_address: String, amount: u128, }, CreateEscrow { payee: Address, amount: u128, asset_id: AssetId, expires_at: u64, release_conditions: ReleaseConditions, }, ReleaseEscrow { escrow_id: [u8; 32], proof: ServiceProof, }, RefundEscrow { escrow_id: [u8; 32], }, PauseAgent { agent_did: String, controller_did: String, reason_code: u16, reason_text: Option<String>, until: Option<Timestamp>, }, QuarantineAgent { agent_did: String, controller_did: String, reason_code: u16, reason_text: Option<String>, evidence_hash: Option<[u8; 32]>, }, TerminateAgent { agent_did: String, controller_did: String, reason_code: u16, slash_bps: u16, cascade: bool, }, PostAgentBond { agent_did: String, controller_did: String, amount: u128, }, IncreaseAgentBond { agent_did: String, amount: u128, }, WithdrawAgentBond { agent_did: String, }, PayInsuranceClaim { claim_id_hex: String, claimant: Address, amount: u128, }, RegisterValidator { consensus_pubkey: Vec<u8>, pq_pubkey: Vec<u8>, bls_pubkey: Vec<u8>, withdrawal_address: Address, self_stake: u128, metadata_uri: String, }, ExitValidator, UpdateValidatorMetadata { metadata_uri: Option<String>, tee_attestation_hash: Option<[u8; 32]>, },
}
Expand description

The type and payload of a transaction.

Different transaction types enable different operations on Tenzro Network.

Uses serde’s default externally-tagged enum representation ({"Transfer": {...}} in JSON, u32 discriminant + payload in bincode). Adjacently-tagged form (#[serde(tag = "type", content = "data")]) is incompatible with bincode 1.x — see tenzro_network::message::MessagePayload.

Variants§

§

Transfer

Transfer TNZO tokens

Fields

§amount: u128

Amount to transfer in the smallest unit

§

ContractDeploy

Deploy a smart contract

Fields

§code: Vec<u8>

Contract bytecode

§args: Vec<u8>

Constructor arguments

§

ContractCall

Call a smart contract

Fields

§function: String

Function signature

§args: Vec<u8>

Function arguments

§

AgentRegister

Register an AI agent

Fields

§config: Vec<u8>

Agent configuration

§

AgentExecute

Execute an agent task

Fields

§task: Vec<u8>

Task specification

§

ModelInference

Request model inference

Fields

§model_id: String

Model identifier

§input: Vec<u8>

Inference input

§

TeeProviderRegister

Register as a TEE provider

Fields

§attestation: Vec<u8>

Attestation data

§info: Vec<u8>

Provider info

§

ProviderStake

Stake tokens for provider operations

Fields

§amount: u128

Amount to stake

§provider_type: String

Provider type

§

ProviderUnstake

Unstake tokens

Fields

§amount: u128

Amount to unstake

§

GovernancePropose

Submit a governance proposal

Fields

§proposal: Vec<u8>

Proposal data

§

GovernanceVote

Vote on a governance proposal

Fields

§proposal_id: String

Proposal ID

§vote: bool

Vote value

§

BridgeTransfer

Initiate a bridge transfer

Fields

§target_chain: String

Target chain

§target_address: String

Target address

§amount: u128

Amount to bridge

§

CreateEscrow

Create a new escrow account, locking funds from the payer

The escrow_id is derived deterministically by the VM as SHA-256("tenzro/escrow/id" || payer || nonce_le) and the funds are transferred to a vault address derived as Address(SHA-256("tenzro/escrow/vault" || escrow_id)[..20]).

Authorization: tx.from must equal the payer (enforced by signature verification).

Fields

§payee: Address

Recipient of funds upon successful release

§amount: u128

Amount to lock in escrow

§asset_id: AssetId

Asset being escrowed

§expires_at: u64

Unix timestamp (millis) at which the escrow expires

§release_conditions: ReleaseConditions

Conditions for releasing funds to the payee

§

ReleaseEscrow

Release escrowed funds to the payee with a proof of service

Authorization: tx.from must equal the original payer.

Fields

§escrow_id: [u8; 32]

32-byte deterministic escrow identifier

§proof: ServiceProof

Proof satisfying the escrow’s release conditions

§

RefundEscrow

Refund escrowed funds to the payer

Authorization: tx.from must equal the original payer AND the escrow must either be expired or use Timeout/Custom release conditions.

Fields

§escrow_id: [u8; 32]

32-byte deterministic escrow identifier

§

PauseAgent

Pause an agent (Agent-Swarm Spec 1, tier 1).

Reversible state. Agent stops accepting new tasks; existing obligations are honored under the pause-bypass allow-list. Stake untouched. Inbound payments still permitted; outbound payments blocked.

Authorization: tx.from MUST equal the agent’s controller DID (or hold a DelegationScope.allowed_operations entry of pause_agent). Network-initiated pauses are not allowed — escalate to Quarantine instead.

Fields

§agent_did: String

DID of the agent to pause (did:tenzro:machine:...)

§controller_did: String

DID of the authorising controller. Must match the identity bound to tx.from; echoed on the wire so the receipt is self-describing and the VM does not need an identity lookup.

§reason_code: u16

Canonical reason code (see kill-switch spec §“Reason codes”)

§reason_text: Option<String>

Optional human reason text, capped at 256 bytes

§until: Option<Timestamp>

Optional pause expiry; None means indefinite (capped by governance pause_max_duration).

§

QuarantineAgent

Quarantine an agent (Agent-Swarm Spec 1, tier 2).

Reversible only after evidence review. Inbound + outbound payments blocked. Stake frozen — cannot withdraw, cannot earn rewards. Existing tasks halt.

Authorization: controller (as PauseAgent), OR slashing-committee quorum via StakingSlashingCallback, OR governance proposal.

Fields

§agent_did: String

DID of the agent to quarantine

§controller_did: String

DID of the authorising controller. Must match the identity bound to tx.from.

§reason_code: u16

Canonical reason code

§reason_text: Option<String>

Optional human reason text, capped at 256 bytes

§evidence_hash: Option<[u8; 32]>

Optional commitment hash to off-chain evidence (32-byte SHA-256)

§

TerminateAgent

Terminate an agent (Agent-Swarm Spec 1, tier 3).

Irreversible. Identity revoked via the underlying revoke_did primitive. Stake/bond slashed by slash_bps capped at the governance slash_bps_cap. With cascade=true, all descendants under the agent’s children: index are terminated recursively (depth-bounded by cascade_max_depth, default 32).

Authorization: controller, OR governance proposal with timelock, OR cascade=true descended from a parent’s TerminateAgent.

Fields

§agent_did: String

DID of the agent to terminate

§controller_did: String

DID of the authorising controller. Must match the identity bound to tx.from.

§reason_code: u16

Canonical reason code

§slash_bps: u16

Basis points of stake/bond to slash (0..=10000), capped per governance slash_bps_cap.

§cascade: bool

If true, recursively terminate descendants under children:.

§

PostAgentBond

Post a fresh AgentBond for agent_did (Agent-Swarm Spec 9).

Locks amount TNZO from tx.from (the controller wallet) into the bond vault derived as Address(SHA-256("tenzro/agent-bond/vault" || agent_did)). The bond enters BondLifecycle::Active and promotes the agent to the Delegated admission lane while ≥ bond_min_for_promotion.

Authorization: tx.from is the controller; the VM enforces that the agent_did either has no prior bond or its prior bond is in a terminal state (Returned / Slashed).

Fields

§agent_did: String

DID of the agent being bonded (did:tenzro:machine:...)

§controller_did: String

DID of the controller posting the bond. Echoed on the wire so the receipt is self-describing without an identity lookup.

§amount: u128

Amount of TNZO to lock in the bond vault

§

IncreaseAgentBond

Top up an existing Active AgentBond by amount.

Authorization: tx.from MUST equal the original poster (the bond’s controller field).

Fields

§agent_did: String

DID of the agent whose bond is being increased

§amount: u128

Additional TNZO to lock

§

WithdrawAgentBond

Initiate the cooldown timer on an Active AgentBond. Funds are not released by the VM — finalisation happens off-VM via the node-side BondManager once cooldown_ms has elapsed.

Authorization: tx.from MUST equal the bond’s controller.

Fields

§agent_did: String

DID of the agent whose bond is being withdrawn

§

PayInsuranceClaim

Pay out an Approved insurance claim from the insurance pool vault to the claimant. The off-chain BondManager has already validated the claim and reserved funds; this transaction performs the on-chain transfer and persists a paid_claim:<claim_id> marker so the same claim cannot be paid twice.

Authorization: governance committee (or tx.from matching the configured insurance-pool admin DID).

Fields

§claim_id_hex: String

32-byte deterministic claim identifier (lowercase hex)

§claimant: Address

Recipient of the payout

§amount: u128

Amount to pay from the pool vault, in TNZO base units

§

RegisterValidator

Register the signing wallet as a Candidate validator (Dynamic Validator Set, 2026-SOTA permissionless join).

On execution the VM emits a ValidatorRegister typed log carrying from || stake_le || consensus_pubkey || pq_pubkey || withdrawal_address || metadata_uri. The node-side ValidatorRegistry consumes the log and inserts a Candidate entry that becomes PendingActive at the next epoch boundary if self_stake >= min_self_stake and the activation churn budget admits it; the EpochManager then promotes it to Active ACTIVATION_EFFECTIVE_DELAY_BLOCKS after the boundary block.

Authorization: tx.from is the validator’s stake-owning wallet. The classical Ed25519 signature in SignedTransaction::signature proves control of consensus_pubkey, the ML-DSA-65 leg proves control of pq_pubkey, and the BLS leg proves control of bls_pubkey.

Fields

§consensus_pubkey: Vec<u8>

32-byte Ed25519 BFT signing key.

§pq_pubkey: Vec<u8>

1952-byte ML-DSA-65 verifying key (FIPS 204). Mandatory hybrid PQ.

§bls_pubkey: Vec<u8>

48-byte BLS12-381 G1-compressed verifying key (min_pk scheme). Mandatory third leg, used by HotStuff-2 to aggregate per-vote signatures into a single QC-level aggregate.

§withdrawal_address: Address

Address rewards / unbonded principal settle to.

§self_stake: u128

Self-stake committed to the candidate. Must be ≥ the registry’s min_self_stake (default 10,000 TNZO).

§metadata_uri: String

Optional ≤256-byte off-chain pointer (moniker / website / contact).

§

ExitValidator

Voluntarily exit the active set (Dynamic Validator Set).

The VM emits a ValidatorExit log; the registry transitions the entry to PendingExit and the next epoch boundary stages it for removal — effective ACTIVATION_EFFECTIVE_DELAY_BLOCKS after that boundary block. Re-registration is blocked for reentry_cooldown_epochs (default 4) following voluntary exit.

Authorization: tx.from MUST equal the validator’s registry address.

§

UpdateValidatorMetadata

Update validator metadata (moniker / TEE attestation commitment).

At least one of metadata_uri or tee_attestation_hash should be Some; the registry treats None as “no change”. tee_attestation_hash is the 32-byte SHA-256 commitment to a fresh attestation document — the active-set boundary applies the TEE multiplier from this commitment.

Authorization: tx.from MUST equal the validator’s registry address.

Fields

§metadata_uri: Option<String>

New off-chain pointer; None = no change. ≤256 bytes when present.

§tee_attestation_hash: Option<[u8; 32]>

New 32-byte SHA-256 commitment to the attestation document.

Trait Implementations§

Source§

impl Clone for TransactionType

Source§

fn clone(&self) -> TransactionType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TransactionType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TransactionType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for TransactionType

Source§

impl PartialEq for TransactionType

Source§

fn eq(&self, other: &TransactionType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TransactionType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TransactionType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.