Budget an Algorand box using the byte length of its name

A box raises the application account’s minimum balance based on both value size and key bytes. A UI counting characters can underfund boxes whose names contain non-ASCII text.

Calculate the incremental requirement

The example encodes a three-character Cyrillic name into six bytes and reserves 80 bytes for its value. For the documented box schedule the increase is 36,900 microAlgos. A name serialized with a prefix or an ABI encoding can occupy more bytes than its user-visible label.

name = "ком".encode("utf-8")
size = 80
required_microalgos = 2500 + 400 * (len(name) + size)
assert len(name) == 6 and required_microalgos == 36900

Reconcile app funding before and after deletion

Compare the app’s balance above its existing minimum with the incremental requirement. Leave room for other operations in the same group. Deleting the box releases its minimum-balance requirement but does not itself transfer money out of the app. Account separately for any explicit refund to a depositor.

Sources