pub struct GenesisBlock {
pub version: String,
pub first_ethics: Vec<String>,
pub ethics_hash: [u8; 32],
pub created_at: u64,
pub architect_pubkey: Vec<u8>,
pub architect_signature: Vec<u8>,
pub block_hash: [u8; 32],
pub genesis_message: String,
}Expand description
The Genesis Block - Immutable First Ethics
This is the root of all mutations. Signed by the Architect. All subsequent filters, rules, and evolutions must be cryptographically descended from this block.
Fields§
§version: StringVersion of the Genesis Protocol
first_ethics: Vec<String>The First Ethics - immutable core rules
ethics_hash: [u8; 32]Hash of the first ethics (for descendant verification)
created_at: u64Creation timestamp (Unix epoch)
architect_pubkey: Vec<u8>The Architect’s public key
architect_signature: Vec<u8>The Architect’s signature over the block
block_hash: [u8; 32]Block hash (self-referential integrity)
genesis_message: StringGenesis message from the Architect
Implementations§
Source§impl GenesisBlock
impl GenesisBlock
Sourcepub fn create(
first_ethics: Vec<String>,
architect_key: &dyn KeyStore,
genesis_message: impl Into<String>,
) -> Result<Self, CryptoError>
pub fn create( first_ethics: Vec<String>, architect_key: &dyn KeyStore, genesis_message: impl Into<String>, ) -> Result<Self, CryptoError>
Create a new Genesis Block signed by the Architect
§Arguments
first_ethics- The immutable core ethical rulesarchitect_key- The Architect’s signing keygenesis_message- Message from the Creator
Sourcepub fn verify(&self, architect_key: &dyn KeyStore) -> bool
pub fn verify(&self, architect_key: &dyn KeyStore) -> bool
Verify the Genesis Block’s integrity and signature
Sourcepub fn is_valid_descendant(&self, mutation_ethics_hash: &[u8; 32]) -> bool
pub fn is_valid_descendant(&self, mutation_ethics_hash: &[u8; 32]) -> bool
Check if a mutation is a valid descendant of this Genesis
Trait Implementations§
Source§impl Clone for GenesisBlock
impl Clone for GenesisBlock
Source§fn clone(&self) -> GenesisBlock
fn clone(&self) -> GenesisBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GenesisBlock
impl Debug for GenesisBlock
Source§impl<'de> Deserialize<'de> for GenesisBlock
impl<'de> Deserialize<'de> for GenesisBlock
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GenesisBlock
impl RefUnwindSafe for GenesisBlock
impl Send for GenesisBlock
impl Sync for GenesisBlock
impl Unpin for GenesisBlock
impl UnwindSafe for GenesisBlock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more