Skip to main content

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 naming system (`IdentityNames`), 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, link references, and
15//!   method identifiers 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, library linking, 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 a deploy that links the libraries a bb verifier
33//!   needs, one deployment per distinct bytecode across the set.
34//!
35//! Signing is the consumer's concern: every helper takes a provider you have
36//! already wired with a wallet.
37
38pub mod artifacts;
39pub mod bindings;
40pub mod circuits;
41pub mod deploy;
42mod error;
43pub mod factory;
44pub mod platform_verifier;
45
46pub use artifacts::Artifacts;
47pub use error::{
48    Error,
49    Result,
50};