Sigil documentation
ReferenceRust referencesigil-core

sigil-core · authority

Source declarations, signatures and documentation for authority.

Source: sigil/node/sigil-core/src/authority.rs. SHA-256: 99ec62c615a12e4fe4d9b9600712a20dfef12daa450a933fe53761209daebe40.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

authority::RootKind

Root identity type.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum RootKind {
    /// Human root.
    Hmr,
    /// Machine/model root.
    Mhr,
    /// Enterprise/entity root.
    Enr,
}

Source line: 12.

authority::AuthorityStatus

Status for root and agent identities.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum AuthorityStatus {
    Active,
    Rotating,
    Revoked,
}

Source line: 24.

authority::WeightedMember

A weighted member in a root group.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct WeightedMember {
pub did: String,
pub weight: u64
}

Source line: 32.

authority::ProfitShare

Profit share assignment in basis points.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProfitShare {
pub recipient_did: String,
pub basis_points: u16
}

Source line: 39.

authority::ThresholdPolicy

Weighted threshold policy.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ThresholdPolicy {
pub threshold_weight: u64,
pub members: Vec<WeightedMember>
}

Source line: 46.

authority::ThresholdPolicy::total_weight

Total configured member weight.

pub fn total_weight(&self) -> u64;

Source line: 53.

authority::ThresholdPolicy::is_satisfied_by

Returns true if the supplied signer DIDs satisfy the threshold.

pub fn is_satisfied_by<'a>(&self, signers: impl IntoIterator<Item = &'a str>) -> bool;

Source line: 58.

authority::Permission

Permission granted to an agent or app agent.

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum Permission {
    IssueAgent,
    RotateAgent,
    RevokeAgent,
    DeployContract,
    CallContract,
    UpgradeContract,
    CreateToken,
    MintToken,
    BurnToken,
    TransferToken,
    CreateTreasury,
    WithdrawTreasury,
    DistributeRevenue,
    ManageApp,
    ManageValidator,
}

Source line: 73.

authority::ControlPolicy

Policy for a controlled object.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "kind", content = "data", rename_all = "snake_case")]
pub enum ControlPolicy {
    /// Any signed transaction sender may perform the action.
    Open,
    /// A single DID controls the object.
    Single { controller_did: String },
    /// Weighted threshold control.
    Threshold(ThresholdPolicy),
    /// A root or group controls the object with specific permissions.
    Delegated {
        controller_did: String,
        delegate_did: String,
        permissions: Vec<Permission>,
    },
}

Source line: 94.

authority::ControlPolicy::is_authorized

Returns true when the supplied signers satisfy this control policy.

pub fn is_authorized<'a>(
        &self,
        actor_did: &str,
        requested_permission: Option<&Permission>,
        signers: impl IntoIterator<Item = &'a str>,
    ) -> bool;

Source line: 111.

authority::AgentKind

Agent role used for lineage and explorer display.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum AgentKind {
    Validator,
    App,
    Service,
    ContractOperator,
    ComputeWorker,
    AutonomousOrg,
}

Source line: 143.

authority::ContractRuntime

Smart contract runtime.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ContractRuntime {
    Wasm,
}

Source line: 155.

authority::SupplyPolicy

Token supply policy.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "kind", content = "data", rename_all = "snake_case")]
pub enum SupplyPolicy {
    Fixed {
        max_supply: u128,
    },
    Controlled {
        controller_did: String,
        max_supply: Option<u128>,
    },
}

Source line: 162.

authority::DistributionPolicy

Revenue distribution policy.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct DistributionPolicy {
pub shares: Vec<ProfitShare>
}

Source line: 174.

authority::DistributionPolicy::is_complete

Returns true when all shares sum to 100%.

pub fn is_complete(&self) -> bool;

Source line: 180.

On this page