> For the complete documentation index, see [llms.txt](https://polarischain-1.gitbook.io/polarischain/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polarischain-1.gitbook.io/polarischain/4.-cryptographic-foundations-and-compliance-framework/4.5-cryptographic-agility-and-migration-choreography.md).

# 4.5 - Cryptographic Agility & Migration Choreography

The protocol is designed to migrate to alternative or higher-security schemes (Dilithium3/5, Falcon, hybrid constructions, or future standards) **without hard forks**.

**Flag-Byte Scheme Tagging**

Each signature, public key, and address representation is prefixed with a single **flag byte** indicating the cryptographic scheme:

| Flag        | Scheme                     | Status           |
| ----------- | -------------------------- | ---------------- |
| `0x01`      | Dilithium2 / ML-DSA-44     | Default in v1.0+ |
| `0x02`      | Dilithium3 / ML-DSA-65     | Reserved         |
| `0x03`      | Dilithium5 / ML-DSA-87     | Reserved         |
| `0x10–0x1F` | Hybrid (PQ + classical)    | Reserved         |
| `0x20–0x2F` | Falcon variants            | Reserved         |
| `0x80–0xFE` | Future PQ schemes          | Reserved         |
| `0xFF`      | Reserved (multisig prefix) | Reserved         |

This design enables:

* Phased migration without breaking existing keys
* Validators and users to operate on different schemes simultaneously
* Gradual rotation (e.g., Dilithium2 → ML-DSA-87 over 5–10 years)
* Deployment of hybrid schemes for defense-in-depth during transitions

The flag byte adds only 1 byte per signature/key — negligible relative to Dilithium2 sizes.

**Migration Choreography**

Scheme migration is a governance-coordinated event following this pattern:

1. **Binary Update:** New scheme added to validator binary; flag-byte handler routes to new verifier.
2. **Transition Epoch:** All validators sign with both old and new schemes for redundancy.
3. **Protocol Flip:** Consensus version update deprecates old scheme; new transactions must use new flag.
4. **Deprecation Window:** Existing balances under old scheme remain spendable for \~1 year during key rotation.
5. **Enforcement:** Transactions signed with deprecated flag are rejected.

This staged approach handles routine standard maturation and emergency response (§8.7 Disaster Recovery).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://polarischain-1.gitbook.io/polarischain/4.-cryptographic-foundations-and-compliance-framework/4.5-cryptographic-agility-and-migration-choreography.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
