Skip to main content

compute_shielded_identity_balance_write_fee

Function compute_shielded_identity_balance_write_fee 

Source
pub fn compute_shielded_identity_balance_write_fee(
    num_actions: usize,
    platform_version: &PlatformVersion,
) -> Result<Credits, ProtocolError>
Expand description

Computes the conservative admission floor (in credits) of a shielded transition that also writes an identity balance (ShieldFromIdentity): compute_minimum_shielded_fee plus the flat identity-write component (SHIELDED_IDENTITY_BALANCE_WRITE_STORAGE_BYTES effective bytes at the per-byte storage rate: the nonce and balance rewrites’ replace-only tree work, folded into one flat figure like the other shielded components).

The transition’s authoritative fee is metered at execution; this floor stands in for it where state is not yet available, so that an identity that could not pay the complete fee is refused before the expensive Orchard proof verification runs. It is also the client-side estimate of the total fee.

Dispatches on the SAME version key (dpp.methods.compute_minimum_shielded_fee) as compute_minimum_shielded_fee so the formulas evolve together across protocol versions.

§Parameters

  • num_actions: number of Orchard actions in the bundle
  • platform_version: protocol version (determines the formula version and fee constants)