I. The Mandate: Why Self-Custody is Non-Negotiable
Most users join decentralized platforms using a convenient email-and-password system. This is a “managed” account, where the service provider holds your cryptographic keys. While user-friendly, this presents an unacceptable single point of failure. If the provider fails or is compromised, your identity is at risk. Self-custody eliminates this risk entirely by placing the master key—the unforgeable deed to your digital property—in your hands alone. This guide details the technical procedure for this essential upgrade to a full Agentic Architecture.
| Attribute | Before Migration (Managed) | After Migration (Sovereign) |
|---|---|---|
Master Key Holder |
The Service Provider. | You (via your secret Recovery Phrase). |
Sovereignty Level |
Low (Tenant). You have access rights. | Absolute (Owner). You have property rights. |
II. The Protocol: A Step-by-Step Guide
This procedure uses official developer tools to interact directly with the AT Protocol. It is safe and sanctioned, but every step must be followed with precision.
Phase 1: Environment Setup (The Workshop)
Before beginning, you must prepare your local computer with the necessary developer environment. This is a one-time setup.
- Install Node.js: Go to `nodejs.org` and download the “LTS” version. Run the installer and accept all default settings.
- Restart Your Computer: After installation, a full system restart is mandatory to ensure the new commands are correctly registered.
- Install Libraries: Open your terminal and run the command: `npm install @atproto/crypto @atproto/api`
Phase 2: The Sovereign Key Generation
This is the most critical step. You will generate your new master key locally. This key will never leave your computer during this process.
- Create the Script: Save the following code in your user directory as `generate_recovery.js`.
const { Secp256k1Keypair } = require('@atproto/crypto'); async function main() { const keypair = await Secp256k1Keypair.create({ exportable: true }); const privateKeyHex = Buffer.from(keypair.privateKey).toString('hex'); const publicKeyDid = keypair.did(); console.log("SECRET_KEY_HEX:", privateKeyHex); console.log("PUBLIC_DID_KEY:", publicKeyDid); } main(); - Run the Script: In your terminal, run: `node generate_recovery.js`
- SECURE YOUR SECRET KEY: The terminal will display your `SECRET_KEY_HEX`. This is your permanent master key. Write it down on physical paper and store it securely offline immediately.
III. The Final Handshake: Committing the Change
The final phase involves using your existing password one last time to authorize the network to accept your new sovereign key, forming a new Knowledge Graph Anchor.
- Request a Security Token: This step requires a script that securely prompts for your password and triggers a one-time code to be sent to your email.
- Finalize the Migration: This step uses a second script that takes your new public key, the security token, and your password to sign and submit the final, irreversible operation.
(Note: Due to the interactive nature of these final steps, they are best performed with a live agent or by following official developer documentation. This process is a form of Digital NDT on your own identity.)
Conclusion: The Responsibility of Sovereignty
Completing this protocol is the definitive act of achieving digital sovereignty. Your identity is no longer rented; it is owned. This ownership carries with it the absolute responsibility to protect your secret key. Guard it with the same seriousness as the deed to your home. By doing so, you have built an identity that is resilient, portable, and truly yours, becoming a verifiable Source of Truth for any Purple Agent to ingest.