hop-actions 2.0.0

Action primitives and centralizer utilities for hop-core streams
Documentation

hop-actions 2.0

crates.io docs.rs

hop-actions defines the checked action contract for HOP channels. An action encodes a polynomial transform g(C), a policy nonce, and optional projection mask metadata.

Version 2.0 provides canonical field-value validation, dimension-checked masks, checked g(C) evaluation and application, and domain-separated, length-framed SHA-256 action identifiers. The framing prevents structural collisions between polynomial and optional-mask fields.

use hop_actions::{apply_action, Action};
use hop_core::{CompanionMatrix, Field};

let companion = CompanionMatrix::try_from_coeffs(&[4, 3, 2])?;
let action = Action::try_new(vec![0, 1], 7, None, companion.dimension())?;
let state = vec![Field::one(), Field::zero(), Field::zero()];
let next = apply_action(&companion, &state, &action)?;
assert_eq!(next, companion.try_apply(&state)?);
# Ok::<(), Box<dyn std::error::Error>>(())

Actions are deterministic algebraic transforms. They are not signatures, encryption, authorization tokens, or randomness.

See the workspace security policy and license.