KilledAccount

Event v101 → current #4

Emitted when an account is reaped (removed from state).

View events on chain
Useful for: walletsanalyticsdevelopersexchanges

The Big Picture

Substrate chains don't keep empty accounts forever. If your balance drops below the existential deposit, your account gets 'reaped' - deleted from chain state. Any remaining dust is lost. This keeps the chain lean but means you need to watch your minimums.

Why This Matters

If your account is killed, you lose any remaining dust balance and your nonce resets. This can cause issues if you're expecting to use that address or if automated systems are sending to it. Keep accounts above the existential deposit to stay alive.

Example Scenario

You have 0.00001 TAO left after a transfer. This is below the existential deposit. System.KilledAccount fires for your address. The dust is gone, and your account no longer exists. If you want to use this address again, someone needs to send you at least the existential deposit to recreate it.

Common Questions

Can I recover a killed account?
The address is fine - just send tokens to recreate the account. But any dust that was in it when killed is permanently lost.
How do I prevent my account from being killed?
Keep your balance above the existential deposit. Use transfer_keep_alive instead of transfer_allow_death to prevent accidentally emptying your account.

Use Cases

  • Detect when accounts are reaped (potential fund loss warning)
  • Track account mortality for network analysis
  • Build safety checks in wallet applications
  • Monitor for unexpected account deaths

How to Use This Event

  • Alert when your accounts are at risk of being reaped
  • Monitor managed accounts for unexpected reaping
  • Track chain-wide account mortality

From Chain Metadata

An account was reaped.

Triggers

Preconditions

  • Account balance fell below existential deposit
  • No locks preventing account removal

Effects

Postconditions

  • Account no longer exists in storage
  • Any remaining dust balance removed

Side Effects

  • Account data permanently lost
  • Nonce reset if account recreated

Event Data

#NameTypeDescription
0
account
AccountId Account that was reaped (balance went to zero) (hex -> SS58)

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Subscribe to KilledAccount events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("System") &&
      event.method === "KilledAccount"
    )
    .forEach(({ event }) => {
      console.log("KilledAccount:", event.data.toHuman());
    });
});

On-Chain Activity

Emission Frequency
●●●○○○ Active 100K–1M emissions

Regular feature-level activity

#34 most emitted event

As of block 7,429,232

Runtime Info

Pallet Index
0
Event Index
4
First Version
v101
Current Version
v393