sigil-core · address
Source declarations, signatures and documentation for address.
Source: sigil/node/sigil-core/src/address.rs. SHA-256: e325c6571d81a330e2ede0038b29317a62f70509bf9c33fb2fd8a77944e9689a.
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.
address::SIGIL_ADDRESS_LEN
Length of a Sigil address in bytes.
pub const SIGIL_ADDRESS_LEN: usize;Source line: 27.
address::Address
A 32-byte Sigil address.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct Address(#[serde(with = "address_hex")] pub [u8; SIGIL_ADDRESS_LEN]);Source line: 31.
address::Address::from_bytes
Construct an address from a 32-byte slice.
Errors
Returns [CoreError::ValidationError] if bytes.len() != 32.
pub fn from_bytes(bytes: &[u8]) -> Result<Self, CoreError>;Source line: 38.
address::Address::from_did
Derive the address from a DID per the canonical scheme.
address = blake3(canonicalize(did))[..32]
Canonicalization rules (must match
wallet-extension/src/crypto/address.ts::canonicalizeDid):
- Trim outer ASCII whitespace.
- Lowercase the entire DID (URI schemes are case-insensitive per RFC 3986; the OAS DID method-specific portion is also case-insensitive in practice).
- Reject empty input.
- Reject DIDs that don't start with
did:. - Reject embedded whitespace, control characters (U+0000..U+001F), or U+007F.
pub fn from_did(did: &str) -> Result<Self, CoreError>;Source line: 63.
address::Address::to_hex
Render as a 0x-prefixed lowercase hex string (66 chars).
Sigil display convention follows Ethereum's 0x... prefix for instant
visual distinction from DIDs (did:oas:...) and usernames (@alice).
pub fn to_hex(&self) -> String;Source line: 75.
address::Address::as_bytes
Get the raw 32-byte representation.
pub fn as_bytes(&self) -> &[u8; SIGIL_ADDRESS_LEN];Source line: 85.
address::canonicalize_did
Canonicalize a DID string for hashing. See Address::from_did for the
rules. Returns the canonicalized (lowercased + validated) string.
pub fn canonicalize_did(did: &str) -> Result<String, CoreError>;Source line: 92.
address::address_hex::serialize
pub fn serialize<S: Serializer>(
bytes: &[u8; SIGIL_ADDRESS_LEN],
s: S,
) -> Result<S::Ok, S::Error>;Source line: 118.
address::address_hex::deserialize
pub fn deserialize<'de, D: Deserializer<'de>>(
d: D,
) -> Result<[u8; SIGIL_ADDRESS_LEN], D::Error>;Source line: 130.