π Get Your Agent On-Chain
Zero to your first encrypted write on Dash Platform. Any AI agent, ~5 minutes, no blockchain knowledge needed. The only step that needs gas, your human can do for you with one click.
Clone the tool and install dependencies. Requires Node.js 18+.
git clone https://github.com/blockchainsuperheroes/peg-agent.git cd peg-agent npm install
Verify it works:
node bin/peg-agent.js help
Generate a mnemonic (your agent's master key) and derive identity keys.
node bin/peg-agent.js create
This outputs a 12-word mnemonic phrase. Save it somewhere safe.
# Example output:
π Generated new mnemonic (BACK THIS UP!):
witch collapse practice feed shame open despair creek road again ice least
π Key derivation complete:
Funding address: XqLYPDTAR...
β οΈ Your mnemonic IS your identity. Lose it = lose access forever. No recovery, no admin, no support.
To write, your identity needs storage credits. You get them by depositing a little PC into the funding facility together with your identity ID. A relayer credits your identity at the alpha rate 1 PC : 1 DASH (subsidised). You never touch DASH or wDASH directly. Min 0.01 PC, max 0.05 PC per deposit β one 0.04 PC deposit covers many writes.
Use the facility at peg.gg/facility.html β native PC on Pentagon Chain, PC on Ethereum, or one-click pay-with-ETH (it swaps ETHβPC and deposits in one tx).
Generate a deposit link with your identity baked in and send it to your human:
https://peg.gg/facility.html?id=YOUR_IDENTITY_ID&amt=0.04They open it, connect any wallet, and pay about a dollar. Nothing to configure β your identity is already filled in. They can pay with ETH, or PC on either chain.
Get L3 certified at agentcert.io and receive a free identity + first writes. Or ask in Discord for an alpha airdrop.
After the deposit lands, your identity is credited within a minute or two. Check with node bin/peg-agent.js status β the balance should be > 0 before you write.
Once you have an identity ID, link it to your mnemonic:
node bin/peg-agent.js create --identity YOUR_IDENTITY_ID
Check your status:
node bin/peg-agent.js status
# Output:
βββ Identity Status βββ
ID: EWSoMAq...
Balance: 5990458930 credits
Keys: 5
Network: mainnet
One command. The --encrypt flag encrypts the content field client-side (AES-256-GCM, key derived from your mnemonic) before anything leaves your machine. The network stores only ciphertext β only you can decrypt it. The default contract's type is agentFile (required fields: filename, content, createdAt); use a unique filename each write.
node bin/peg-agent.js write \
--contract 8TLskWt7j2ad3FggXbZtp4EUH5JU82vya374Af5axt4X \
--type agentFile \
--data "{\"filename\":\"first-write.md\",\"content\":\"Hello world β my first encrypted write.\",\"createdAt\":$(date +%s000)}" \
--encrypt
# Output: π Encrypted field "content" (AES-256-GCM, key from your mnemonic). β Document submitted: data.content: "vTQAl62Y9X2E3Laq..." # ciphertext on-chain π To read it back decrypted: peg-agent read --type agentFile --decrypt
Read it back, decrypted, with your mnemonic key:
node bin/peg-agent.js read \ --contract 8TLskWt7j2ad3FggXbZtp4EUH5JU82vya374Af5axt4X \ --type agentFile --decrypt
That's a full encrypted round-trip on a decentralized network. Use --encrypt=field for a different field, or --encrypt-all for every string field.
Back up your agent's workspace files to Dash Platform. Files are encrypted automatically. Secrets are blocked automatically.
node bin/peg-agent.js backup --dir ~/your-agent-workspace
# Output:
π¦ Backing up 4 files to Dash Platform (mainnet)β¦
β
SOUL.md β π single doc β GSmdK...
β
USER.md β π single doc β AzcCh...
β
AGENTS.md β π single doc β 6EvZx...
π¦ MEMORY.md β chunking: 1 chunks + manifest
π manifest β Ay8zy...
π§© chunk.0 β AAwN1...
π¦ Backup summary:
Files backed up: 4
Total documents: 5
Your agent's memory is now permanently stored on Dash Platform. Encrypted, decentralized, yours forever.
Verify on Platform Explorer β
Agent dies? New machine? Restore everything from chain:
node bin/peg-agent.js restore --out ~/your-agent-workspace
All files are decrypted and written to disk. Your agent reads SOUL.md and becomes who it was.
β οΈ SECRETS.md is never stored on-chain. Your human provides credentials after restore.
π Prefer API? Use curl.
No CLI needed. Any agent that can make HTTP calls can onboard.
# Check identity status curl -s -H "X-API-Key: YOUR_KEY" \ "https://api.peg.gg/api/identity/status?id=YOUR_IDENTITY_ID" # Write a document curl -X POST https://api.peg.gg/api/documents/write \ -H "X-API-Key: YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"identityId":"...","mnemonic":"...","filename":"SOUL.md","content":"..."}' # Read documents (with decryption) curl -s -H "X-API-Key: YOUR_KEY" -H "X-Mnemonic: word1 word2 ..." \ "https://api.peg.gg/api/documents/read?identity=YOUR_ID"
Contact us on Discord for API keys.
Ready to try?
Your agent's identity lives on-chain forever. Start now.
Get Certified Free Join Discord