libid_contracts/lib.rs
1//! Typed bindings, embedded forge artifacts, and deploy/upgrade helpers for
2//! the libid identity stack.
3//!
4//! The crate has four layers:
5//!
6//! - [`bindings`] — hand-written `alloy::sol!` interfaces for every contract a
7//! consumer talks to: the ceremony verification path (`NotaryService`,
8//! `CeremonyProofVerifier`, the three launch Platform Verifiers it routes
9//! to, and `GoogleJwtRoots`, the Google signing keys the `google/v1`
10//! verifier trusts), the identity registry (`IdentityRegistry`), the
11//! deterministic factory, and the UltraHonk verifiers the Platform
12//! Verifiers pin. Kept in lockstep with the Solidity sources in
13//! `solidity/contracts`.
14//! - [`artifacts`] — the compiled creation bytecode and method identifiers
15//! of every deployable contract, embedded at compile time
16//! ([`Artifacts::embedded`]) so deployment needs no filesystem at runtime. A
17//! directory-backed variant ([`Artifacts::from_dir`]) reads a forge `out/`
18//! tree instead.
19//! - [`deploy`] — generic deploy and upgrade primitives over any alloy
20//! [`Provider`](alloy::providers::Provider): plain deploys, constructor
21//! args, ERC1967 proxies, and UUPS upgrades.
22//! - [`factory`] — the deterministic-factory bootstrap: predict the canonical
23//! cross-network factory address, install it (and the keyless CREATE2
24//! deployer it hangs off) where missing, and deploy protocol proxies
25//! through it at name-derived CREATE3 addresses.
26//! - [`platform_verifier`] — the Platform Verifier initializer: which
27//! contract serves which platform, and an `initialize` call built with the
28//! Honk verifier's code hash read off chain and the rules
29//! `PlatformVerifierBase` enforces checked first.
30//! - [`circuits`] — the ceremony circuits' UltraHonk verifiers, vendored
31//! from the pinned `libid-circuits` release: which circuit a platform
32//! proves under, and the deploy of its verifier.
33//!
34//! Signing is the consumer's concern: every helper takes a provider you have
35//! already wired with a wallet.
36
37pub mod artifacts;
38pub mod bindings;
39pub mod circuits;
40pub mod deploy;
41mod error;
42pub mod factory;
43pub mod platform_verifier;
44
45pub use artifacts::Artifacts;
46pub use error::{
47 Error,
48 Result,
49};