This document details the deployment, architecture, and security properties of the shadowid_v5.aleo protocol.
- Program ID:
shadowid_v5.aleo - Network: Aleo Testnet
- Status: Deployed
- Transaction ID:
at1hv9tymzr3p3kq8nngqakt2tdzcwzh4v5pm00dtkql5r0n00ceq8qkwwws4
The shadowid_v5.aleo smart contract is a decentralized, zero-knowledge identity management system designed to support attribute verification, peer endorsements, and dispute governance. Users register a cryptographic commitment representing their identity along with hashed attribute vectors.
- Uses
commitmentsmappings to bind a cryptographic field element to a block height timestamp. - Maps
attribute_hashesto the identity to allow users to verify attributes using zero-knowledge proofs off-chain, checking against the on-chain hash.
- Identities can be endorsed by peers using
endorse_attribute. - Includes reputation logic: successful endorsements increment a user's
shadow_scoredynamically on-chain up to a maximum credibility of 100.
- Enables a governance layer where external addresses can submit
challenge_endorsementtransactions to flag false claims. - Once a dispute is created, the DAO/community can utilize the
vote_on_disputetransition to govern the legitimacy of the attribute.
- Provides a registry (
register_custom_attribute) to extend base attributes, binding unique text vectors to commitments.
- Issue: Anyone could re-register over an existing
commitmentfield, resetting the user's score to 50 and changing their attribute hashes. - Fix: Added
assert(exists == 0u64);withinfinalize_register_committo ensure identities are immutable once created.
- Issue: Previous Aleo 3.4.0 syntax limits inline
hash_to_fieldfunctions to 1 or 2 variables, making it difficult to securely hashtarget_commitment,attribute_id, andendorser_addressinto a single dedup key without losing security constraints or causing compiler panics. - Fix: Introduced explicit structs (
EndorsementHash,DisputeHash,CustomAttrHash,VoteHash) to neatly pack variables and pass them intoPoseidon8::hash_to_field. This guarantees perfectly secure, multi-variable hashing natively.
- Issue: Users could vote on fake
dispute_keyelements that were never officially challenged. - Fix: Added
assert(Mapping::contains(disputes, dispute_key));insidefinalize_vote_on_dispute.
- Issue: A malicious user could challenge an endorsement that never occurred on-chain, creating fake governance noise.
- Fix:
finalize_challenge_endorsenow strictly enforcesassert(Mapping::contains(endorsements, dedup_key));to verify the attestation exists before a dispute can open.
Guide authored by Jules, Automated Aleo Software Engineer.