Skip to content

Extension Points

The PoT-O validator is built around five trait-based extension points. Each trait has a working default implementation and stubbed future variants.

Overview

ExtensionTraitActiveStubbed
Device miningDeviceProtocolNativeDeviceESP32SDevice, ESP8266Device, WasmDevice
Multi-nodePeerNetworkLocalOnlyNetworkVpnMeshNetwork
Pool strategyPoolStrategySoloStrategyProportionalPool, PPLNSPool
Chain bridgeChainBridgeSolanaBridgeEvmBridge, CrossChainBridge
SecurityProofAuthorityEd25519AuthorityMtlsAuthority, HmacDeviceAuth

Configuration

Extension implementations are selected via environment variables:

bash
PEER_NETWORK_MODE=local_only   # or: vpn_mesh
POOL_STRATEGY=solo             # or: proportional, pplns
CHAIN_BRIDGE=solana            # or: evm, cross_chain
DEVICE_PROTOCOL=native         # or: esp32s, esp8266, wasm

Adding a New Implementation

  1. Create a struct that implements the relevant trait in extensions/src/
  2. Register it in the ExtensionRegistry construction logic
  3. Add the config variant to config.rs

No changes to the mining core (pot_o.rs, mml_path.rs, neural_path.rs) are needed.

Trait Details

DeviceProtocol

rust
pub trait DeviceProtocol: Send + Sync {
    fn device_type(&self) -> DeviceType;
    fn max_tensor_dims(&self) -> (usize, usize);
    fn max_working_memory(&self) -> usize;
    fn heartbeat(&self) -> TribeResult<DeviceStatus>;
}

PeerNetwork

rust
#[async_trait]
pub trait PeerNetwork: Send + Sync {
    fn node_id(&self) -> &NodeId;
    async fn discover_peers(&self) -> TribeResult<Vec<PeerInfo>>;
    async fn broadcast_challenge(&self, challenge: &Challenge) -> TribeResult<()>;
    async fn relay_proof(&self, proof: &ProofPayload) -> TribeResult<()>;
    async fn sync_state(&self) -> TribeResult<NetworkState>;
}

PoolStrategy

rust
pub trait PoolStrategy: Send + Sync {
    fn pool_type(&self) -> PoolType;
    fn calculate_shares(&self, proofs: &[ProofRecord], reward: u64)
        -> TribeResult<Vec<MinerShare>>;
    fn minimum_stake(&self) -> u64;
    fn accept_miner(&self, miner: &MinerInfo) -> TribeResult<bool>;
}

ChainBridge

rust
#[async_trait]
pub trait ChainBridge: Send + Sync {
    async fn submit_proof(&self, proof: &ProofPayload) -> TribeResult<TxSignature>;
    async fn query_miner(&self, pubkey: &str) -> TribeResult<Option<MinerAccount>>;
    async fn get_current_difficulty(&self) -> TribeResult<u64>;
    async fn request_swap(&self, from: Token, to: Token, amount: u64)
        -> TribeResult<TxSignature>;
}

ProofAuthority

rust
pub trait ProofAuthority: Send + Sync {
    fn verify_miner_identity(&self, pubkey: &str, sig: &[u8]) -> TribeResult<bool>;
    fn sign_challenge(&self, challenge: &Challenge) -> TribeResult<Vec<u8>>;
    fn validate_node_connection(&self, peer: &PeerInfo) -> TribeResult<bool>;
}

TribeWarez Blockchain Ecosystem