soft3/bbg/rs/src/types.rs

// ---
// tags: bbg, rust
// crystal-type: source
// crystal-domain: cyber
// ---
//! Core record types for BBG authenticated state.

/// Particle: 32-byte hemera hash.
pub type Particle = [u8; 32];

/// Neuron identifier: 32-byte hemera hash.
pub type NeuronId = [u8; 32];

/// A particle in the cybergraph.
///
/// axon-particles carry weight/s_yes/s_no/meta_score.
/// content-particles carry energy/pi_star.
/// both share the same record type โ€” unused fields are zero.
pub struct ParticleRecord {
    /// aggregate energy from incoming axons (content-particles)
    pub energy: u64,
    /// focus ranking from tri-kernel (updated by cybergraph, not bbg)
    pub pi_star: u64,
    /// aggregate conviction (axon-particles only)
    pub weight: u64,
    /// ICBS YES reserve (axon-particles only)
    pub s_yes: u64,
    /// ICBS NO reserve (axon-particles only)
    pub s_no: u64,
    /// aggregate valence prediction (axon-particles only)
    pub meta_score: u64,
}

impl ParticleRecord {
    pub fn zero() -> Self {
        Self { energy: 0, pi_star: 0, weight: 0, s_yes: 0, s_no: 0, meta_score: 0 }
    }
}

/// A neuron (agent) in the cybergraph.
pub struct NeuronRecord {
    /// available attention budget
    pub focus: u64,
    /// accumulated BTS score (updated by cybergraph)
    pub karma: u64,
    /// total committed conviction
    pub stake: u64,
}

/// A geolocation record.
pub struct LocationRecord {
    pub lat: i32,
    pub lon: i32,
}

/// A coin (token) record.
pub struct CoinRecord {
    pub total_supply: u64,
}

/// A card in the cards dimension.
///
/// Every cyberlink is a card (A6). This records the current beneficial owner
/// of the conviction box attached to an axon-particle.
pub struct CardRecord {
    /// current owner neuron
    pub owner: NeuronId,
    /// axon-particle this card is bound to
    pub particle: Particle,
}

/// A file availability record.
pub struct FileRecord {
    pub available: bool,
    pub chunk_count: u32,
}

/// A signal finalization record committed to the signals dimension.
pub struct SignalRecord {
    pub neuron: NeuronId,
    /// destination network this signal was delivered to (a card id)
    pub network: Particle,
    pub link_count: u32,
    pub block_height: u64,
    pub proof_hash: Particle,
}

/// An intent record committed to the intents dimension.
///
/// An intent is an unsealed declaration: the neuron commits to a scope
/// and signs it, but the STARK proof is deferred until sealing. If the
/// intent is never sealed, the record persists at its inception height โ€”
/// abandonment is on the record.
pub struct IntentRecord {
    /// declaring neuron
    pub neuron: NeuronId,
    /// inception height
    pub h0: u64,
    /// hash of the structured scope (target, predicate, deadline, constraints)
    pub scope_hash: Particle,
    /// neuron's signature over (ฮฝ โ€– h0 โ€– scope_hash)
    pub signature: [u8; 64],
}

Homonyms

soft3/glia/import/types.rs
warriors/trisha/honeycrisp/types.rs
neural/trident/src/import/types.rs
neural/trident/src/typecheck/types.rs
soft3/zheng/rs/src/types.rs
soft3/lens/core/src/types.rs
neural/rs/darwin-sys/src/ffi/types.rs
neural/trident/src/package/registry/types.rs
neural/trident/src/syntax/parser/types.rs
bootloader/go-cyber/cw/packages/cyber-std/src/types.rs
cyb/evy/forks/naga/src/compact/types.rs
neural/trident/src/neural/data/tir_graph/types.rs
cyb/evy/forks/naga/src/front/glsl/types.rs
bootloader/go-cyber/cw/packages/cyber-std/src/tokenfactory/types.rs
cyb/evy/forks/naga/src/front/glsl/parser/types.rs

Graph