tenzro-types
Foundation crate providing shared types for the Tenzro Network.
Overview
tenzro-types is the foundational crate with zero internal dependencies. It defines all shared types, primitives, and data structures used across the Tenzro Network workspace, including blockchain primitives, AI-specific types, financial structures, and Canton/DAML integration types.
Modules
Public modules: primitives, transaction, block, account, asset, network, tee, agent, model, settlement, token, governance, bridge, wallet, canton, identity, fees, task, agent_template, skill, tool, error, config, constants, runtime, validation, cortex, training, principal_chain, kill_switch, intent_7683
Primitives
Hash- 32-byte hash typeAddress- Variable-length address type (32 bytes default)Signature- Cryptographic signatureBlockHeight,Nonce,Timestamp,ChainId
Domain Types
Account,AccountState- Account information and stateBlock,BlockHeader,ConsensusProof- Block structuresTransaction,TransactionType,SignedTransaction- Transaction typesAsset,AssetId,AssetType,StablecoinType,AssetInfo- Asset managementNetworkRole,PeerInfo,NodeInfo- Network peer information
AI & Agent Types
AgentIdentity,AgentConfig,AgentMessage,AgentMessageType,Capability- AI agent infrastructureModelInfo,ModelLoadInfo,ModelModality- Model registry.ModelModalitycovers Text, Image, Audio, Video, Embedding, Multimodal, Code, and Timeseries.VisionParameters,AudioParameters,VideoParameters,TimeseriesParameters- Optional sidecar parameters onModelInfoInferenceRequest,InferenceResponse,InferenceParameters,InferencePayload- Inference operations.InferencePayloadis a typed enum (Chat | Forecast | VisionEmbed | VisionSimilarity | TextEmbed | Segment | Detect | Transcribe | VideoEmbed) consumed by the modality-awareInferenceRouter.InferenceProvider,ProviderCapacity,PricingConfig- Provider management
Financial Types
SettlementRequest,SettlementReceipt,SettlementStatus- Payment settlementReleaseConditions,ServiceType,PaymentIntent,ServiceProof,ProofType- Settlement conditionsTokenConfig,Treasury,StakingPool- Token economicsProviderStake,ProviderType- Staking infrastructure
Governance Types
GovernanceProposal,ProposalStatus,ProposalType- Governance proposalsGovernanceVote,VoteType- Voting
Identity Types
KycTier- KYC verification levels (Unverified, Basic, Enhanced, Full)IdentityType- Human or Machine identityPaymentProtocolId- Payment protocol identifiers (Mpp, X402, Direct, Channel, Custom)
Canton/DAML Types
DamlContractId,DamlTemplateId,DamlPartyDamlValue,DamlCommand,DamlEvent,DamlTransactionCantonSynchronizerId,CantonDomainId,CantonParticipantConfigCantonCommandStatus,DamlPackageInfo,TopologyTransactionParticipantPermission,SynchronizerConfig
Bridge Types
BridgeMessage,BridgeProtocol,BridgeTransfer- Cross-chain bridge operations
ERC-7683 Cross-Chain Intents (intent_7683 module)
CrossChainOrder,GaslessCrossChainOrder- User-signed open envelopesResolvedCrossChainOrder-IOriginSettler.resolvereturn shapeOutput,TargetOutput- Chain-discriminated 32-byte recipient + uint256 amountFillInstruction- Per-output destination dispatchTenzroOrderData- Tenzro-native opaque payload carried inside the 7683 envelopeTokenAmount- 32-byte token id + uint256 amountProofRoute- LayerZero / Wormhole / DeBridge / Hyperlane fill-proof routeOrderState- Open → AwaitingProof → Settled / Refunded / ForceRefundEligibleTenzro7683Order- On-chain envelope persisted under the7683_origin:keyspacecompute_order_id(order)-SHA-256("tenzro/7683/order" || swapper || nonce_le || origin_chain_id_le || fill_deadline_le || order_data_type || order_data)u128_to_uint256_be/uint256_be_to_u128- Big-endian uint256 conversion (rejects non-zero high 128 bits)- CAIP-2 chain IDs:
TENZRO_MAINNET_CHAIN_ID = 0x10ED20,TENZRO_TESTNET_CHAIN_ID = 0x10ED21
Wallet Types
WalletInfo,WalletType- Wallet management
Task & Marketplace Types
TaskInfo,TaskStatus,TaskType,TaskPriority,TaskQuote,TaskFilterAgentTemplate,AgentTemplateStatus,AgentTemplateType,AgentCapabilityAgentRuntimeRequirements,AgentPricingModel,AgentExampleAgentTemplateFilter,AgentTemplateInstanceSkillDefinition,SkillStatus,SkillFilter,SkillInvocationResultToolDefinition,ToolStatus,ToolFilter,ToolInvocationResult
Runtime Types (RFC-0007: Adaptive Execution Upgrade)
ModelClass,ExecutionMode,ArtifactCompleteness,ArtifactTypeKVProfile,WorkerRole,ExecutionSupport,ModelTopologyPlacementConstraints,RoutingPolicy,RequiredExecutionRuntimeSupport,TrustProfile,NodeNetworkProfileArtifactMetadata,ExecutionPlan,ExecutionReceipt,CapabilityResolution
Configuration & Fees
NetworkConfig,NodeConfig- Network configurationServiceFeeSchedule,NetworkCommissionRates- Fee structures
TEE Types
TeeVendor,AttestationReport,AttestationResultTeeCapacity,TeeProviderInfo
Error Types
TenzroError- Unified error type for the network
Constants
- Chain constants and parameters exported via
constantsmodule
Usage
Add to Cargo.toml:
[]
= { = "../tenzro-types" }
Example:
use ;
use ;
use Block;
use NetworkRole;
// Create a new address
let address = from_bytes?;
// Work with transactions
let tx = Transaction ;
Dependencies
serde,serde_json- Serializationthiserror- Error handlingbytes,hex,bs58- Data encodingchrono- Timestamp handlinguuid- Unique identifierssha2,sha3- Hashing utilities
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (http://opensource.org/licenses/MIT)
at your option.