CurrentKey

Storage Plain v361 → v411 Changed in v411

The currently active ML-KEM-768 public key for encrypting MEV -protected transactions.

Explore chain
Queried by: developerswalletsvalidators

The Big Picture

CurrentKey is the decryption-side key in the MevShield protocol. The block author who announced this key holds the matching private key and uses it to decrypt encrypted submissions. Users should NOT read CurrentKey for encryption — instead, read NextKey, which is the key announced by the upcoming block author. CurrentKey exists so the current block author can identify which private key to use for decryption.

Why This Matters

To submit an MEV-protected transaction, you need the current encryption key. Without it, you can't encrypt your transaction for protection. If CurrentKey is None, MEV protection isn't available.

Example Scenario

You want to submit an encrypted swap. Query NextKey - if Some(key), use it to encrypt your transaction via ML-KEM + XChaCha20-Poly1305. If None, no validator has announced a key and MEV protection isn't available. CurrentKey is only relevant for the block author's decryption side.

Common Questions

Should I use CurrentKey or NextKey?
Always use NextKey for new encrypted submissions. CurrentKey is the decryption-side reference — the block author who announced this key uses the matching private key to decrypt submissions that were encrypted with it when it was still NextKey. By the time a key is in CurrentKey, new submissions should use the newer NextKey instead.
What if CurrentKey is None?
MEV protection isn't available. Either the previous block author didn't announce a key, or the network hasn't enabled MevShield. Submit transactions normally (unencrypted).

Use Cases

  • Encrypt transactions for MEV protection
  • Verify key is available before submission
  • Build MEV-protected wallet interfaces

From Chain Metadata

Current block author's ML-KEM-768 encapsulation key (internal, not for encryption).

Purpose & Usage

Purpose

Provides the encryption key users should use for the current block's submissions.

Common Query Patterns

  • Query to get current encryption key
  • Check if MEV protection is available

Notes

  • ML-KEM-768 public key in encoded form
  • None if no key was announced (MEV protection unavailable)
  • Rotates each block as NextKey becomes CurrentKey
Part of: MEV Shield

Stored Value

value (BoundedVec)

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query CurrentKey storage (no keys - plain value)
const result = await api.query.MevShield.CurrentKey.getValue();
console.log("CurrentKey:", result);

Version History

v361 block 7,063,679 Added
v363–v364 · runtime versions skipped on chain (never deployed)
v365 block 7,135,419 Internal re-bind
v378–v384 · runtime versions skipped on chain (never deployed)
v385 block 7,782,670 Internal re-bind
v386–v390 · runtime versions skipped on chain (never deployed)
v391 block 7,782,857 Internal re-bind
v394–v400 · runtime versions skipped on chain (never deployed)
v401 block 8,036,576 Internal re-bind
v403–v410 · runtime versions skipped on chain (never deployed)
v411 block 8,283,784 Internal re-bind Current

Runtime Info

View Source
Pallet
MevShield
Storage Kind
Plain
First Version
v361
Current Version
v411