Skip to main content

Module trust

Module trust 

Source
Expand description

Foreign-account trust profiles.

Configurable validation policies for loading accounts owned by external programs. Each profile defines which checks to enforce, allowing programs to explicitly declare their trust assumptions.

§Trust Levels

  • Strict: owner + layout_id + exact size + not frozen/closed
  • Compatible: owner + layout_id + minimum size (supports newer versions)
  • Observational: layout_id only, best-effort (indexers/tooling)
let profile = TrustProfile::strict(&KNOWN_PROGRAM_ID, &MyLayout::LAYOUT_ID, MyLayout::LEN);
let data = profile.load(account)?;
let overlay = MyLayout::overlay(data)?;

Structs§

TrustFlags
Policy flags for additional constraints.
TrustProfile
A foreign-account trust profile.

Enums§

TrustLevel
Trust level for foreign account validation.

Functions§

load_foreign_with_profile
Load a foreign account with a trust profile, returning a typed overlay.