Programmable infrastructure for decentralized communication. Identity, encryption, consent-based routing, and encrypted storage — without trusted servers.
E2EE protects content. Decentrl protects everything else.
// architecture
const keys = generateIdentityKeys() // keys.signing → Ed25519 keypair // keys.encryption → X25519 keypair // keys.storageKey → AES-256 (never shared) const did = createDecentrlDidFromKeys( 'alice', keys, 'did:web:mediator.decentrl.io' ) // → did:decentrl:YWxpY2U:z6Mk...
// Establish mutual consent await client.contracts.request(bobDid) // Bob accepts on his side await client.contracts.accept( request.id, request.encryptedPayload, request.requestorEphemeralPublicKey, ) // Root secret derived locally // No secret ever crosses the network
await client.publish('chat.message', { id: crypto.randomUUID(), chatId: 'abc', text: 'Hello Bob', }) // 1. Validated against Zod schema // 2. Signed with Ed25519 // 3. Encrypted → sent to Bob's mediator // 4. Re-encrypted → stored on yours
defineDecentrlApp().// developer experience
Define events and reducers. Get identity, encryption, contracts, and sync for free.
import { defineDecentrlApp } from '@decentrl/sdk' import { z } from 'zod' const app = defineDecentrlApp({ events: { 'chat.message': { schema: z.object({ id: z.string().uuid(), chatId: z.string(), text: z.string(), }), tags: ['chat.$${chatId}'], }, }, state: { messages: { initial: [], reduce: { 'chat.message': (s, d) => s.some(m => m.id === d.id) ? s : [...s, d], }, }, }, })
import { useDecentrl, useDecentrlState } from '@decentrl/sdk-react' function Chat({ chatId }) { const { publish } = useDecentrl() const messages = useDecentrlState( s => s.messages.filter( m => m.chatId === chatId ) ) return ( <div> {messages.map(m => ( <Message key={m.id} data={m} /> )))} <Composer onSend={text => publish('chat.message', { id: crypto.randomUUID(), chatId, text, }) } /> </div> ) }
// protocol lifecycle
Three keys generated on-device. Your DID embeds public keys and mediator endpoint — anyone can verify you and send you a contract request without a registry lookup.
Both parties exchange ephemeral X25519 keys and sign with Ed25519. A shared root secret is derived locally — no secret ever crosses the network.
Events are encrypted, signed, and dual-delivered — one copy to the recipient, one to your own mediator. Both parties keep complete records. The mediator sees nothing.
// get started