Roles and separation
Use distinct Stellar addresses and keys, hardware/KMS-backed signing, documented thresholds, least-privilege scopes, and independent approvers. Record public address/fingerprint and policy metadata, never seeds.
Preflight for every privileged action
- verify the contracts release tag/commit, spec/binding/WASM digests, deployment manifest, network passphrase, contract ID, live code hash, interface/storage version, and current ledger;
- read current admin/pending-admin, pause, attestors, schema, TTL, and relevant evidence directly from the verified contract;
- bind intent to exact method/arguments, expected old/new state, event, resource budget, fees, time/ledger bounds, and incident/change record;
- simulate and reject unexpected authorization, sub-invocation, storage footprint, event, return value, or resource use;
- obtain required human approvals and sign with the expected address only;
- submit idempotently, reconcile unknown outcomes by transaction hash/state/event, and verify postconditions;
- update the audit record and deployment/release manifest where required.
Manage attestors
Registration binds address, metadata hash, purpose, environment/network, owner, approval, activation, expiry/review date, and allowed publisher policy. The metadata document is off-chain, versioned, redacted, and digest-verified. Before enabling, verify signer control and run one non-mutating authorization check. Useregister_attestor for a new record and set_attestor_enabled for lifecycle changes only if those names match the generated spec. Confirm attestor_set event and live state.
Disable immediately on owner loss, key compromise, role change, expired review, policy violation, or decommission. Disabling blocks new publication but does not erase historical records. Inventory active/queued signing requests, revoke backend signer access, rotate related secrets, assess publications, and revoke/supersede evidence separately where justified.
Pause and resume
The planned invariant is precise: pause blocks publish, supersede, and upgrade; reads and authorized revocation remain available. It does not cancel submitted ledger transactions, revoke attestors, expire evidence, hide history, or repair compromised records. Before pausing, identify the incident/change, read current state, simulateset_paused(true), approve, submit, verify pause_changed, then prove a new publication is rejected while read and revoke behavior matches the generated tests. Notify publishers/indexers.
Resume only after root cause and signer/deployment integrity are verified. Re-read code hash/admin/attestors, reconcile queued work rather than replaying blindly, simulate, approve, submit, verify event/state, and perform one bounded synthetic publication on the allowed environment. A failed resume keeps the system paused.
Two-step administrator transfer
The current administrator proposes one exact new address; the proposed address independently accepts. The proposal records old/new addresses, network/contract/code hash, reason, expiry/cancellation policy, approvals, transaction/event, and signer-control evidence. Before proposal, prove the candidate is not a contract/test-fixture address by mistake and can authorize on the intended network. Confirmadmin_proposed while old admin remains active. Before acceptance, both parties reverify the unchanged proposal and deployment. The candidate invokes accept_admin; confirm admin_changed, new authority succeeds, and old authority fails.
Wrong-address, expired, replaced, already-accepted, self-transfer, unexpected pending state, or uncertain submission stops the procedure. If the candidate cannot accept, use the released cancellation/replacement path; never share the old key as a workaround.
Storage and TTL inventory
Instance state contains administrator, pending administrator, pause, and schema version. Persistent state contains evidence and attestor records. For every key class, the release must document durability class, initial TTL, extension threshold/amount, maximum, caller authorization, per-call key limit, resource/cost budget, archive behavior, and restoration support. Maintain an inventory of active/recent/superseded/revoked evidence, attestors, instance/code state, oldest TTL, projected expiration, last extension, and indexed event range. Contract state is authoritative; indexes are rebuildable views.Maintenance cadence and cost
Run TTL maintenance well before the archival threshold, with enough margin for scheduler, RPC, signer, and ledger outages. Select keys from verified state/index checkpoints, bound each batch, simulate, compare expected footprint and resources, authorize with the dedicated identity, submit, and reread TTL at a finalized ledger. Measure CPU/memory instructions, read/write bytes, event bytes, transaction size, base/resource/refundable fees, records per batch, total live records, monthly growth, and retry reserve on local and testnet. Pubnet launch requires measured price assumptions, budget owner, alert thresholds, and funded reserve. Never present an estimate as measured cost. On missed maintenance, pause new publication if safety margin is breached, prioritize instance/code/admin/attestor and policy-required records, verify archive restoration behavior, rebuild indexes from events, and document evidence whose direct state is no longer available. Do not fabricate restored state from a cache.Reproducible WASM
An upgrade candidate comes from a protected tag and full commit with pinned Rust/Stellar toolchain, lock files, container digest, source date/build flags, optimized WASM, generated spec JSON/XDR, bindings, WASM SHA-256, SBOM/provenance, test and resource-budget results, and security review. At least two clean builders reproduce byte-identical optimized WASM or the release documents and resolves nondeterminism. Compare generated interface, errors, events, auth requirements, storage access, and budgets against the deployed release. An unexplained digest or spec difference blocks promotion.Schema and compatibility protection
Prefer additive behavior that preserves old record interpretation. The deployed schema/storage version is explicit. An upgrade cannot silently change hash construction, evidence ID, bitmap, status, counts/score meaning, event topics/data, authorization, pause semantics, key encoding, or TTL behavior. If old data needs transformation, publish a versioned migration with resumable checkpoints, idempotency, resource limits, invariant checks, and rollback/forward plan. A breaking evidence representation normally deploys a new contract and migration index; old records remain under their original code/schema rather than being reinterpreted.Testnet rehearsal
The stored planned rehearsal record enumerates required evidence but contains no deployment or signer. A real rehearsal starts from a production-like testnet snapshot/fixture and follows only released scripts:- reproduce old/new WASM and verify all bundle digests;
- run unit, integration, property, fuzz, resource, binding/spec, and compatibility suites;
- deploy/initialize old code and seed active, superseded, revoked, attestor, pause, and near-threshold TTL cases;
- export state/event/index checkpoints and verify pre-upgrade reads;
- rehearse pause if required, simulate upgrade, review auth/footprint/events/budget, and submit the reviewed hash;
- verify live code hash/schema, every old read/status/link, auth rejection, new publication, supersede/revoke, pause, TTL, and event sequence;
- replay all events into an empty index and compare it with direct state;
- exercise rollback eligibility or the forward-fix path and verify no undocumented step;
- record transactions, ledgers, hashes, costs, times, approvers, results, and remaining gaps.