Protocol
DePIN messaging and tokens
DePIN tokens (&NAME) define who belongs to a network of devices or people. Holders of a token
can exchange end-to-end encrypted messages through nodes that run a message pool, with no
fees and nothing written to the chain. It runs on testnet and regtest only.
On-chain
DePIN tokens
- Names start with
&: root&NAME, sections&NAME/SUB, owner token&NAME!. - Soulbound. Holders cannot transfer them; only the owner token can issue, move, freeze or unfreeze. A holder may burn its own.
- Whole units (units = 0), and the same burn cost as a unique asset.
- Transfer state (from block 10): the owner can open, close or permanently seal a token.
- A message to a section reaches the active holders of that section and of every parent up to the root.
Off-chain
Message pool, protocol 2
| Message expiry | 7 days (default) |
|---|---|
| Recipients per message | 20 by default, up to 50 |
| Message size | 1,024 bytes |
| Encryption | ECIES secp256k1 + AES-256-GCM |
| Fees | None: messages never touch the chain |
| Addresses | Legacy P2PKH (t…) with a revealed public key |
Try it
Where to use DePIN on testnet
Web Wallet: Chat and IoT
Issue a DePIN token from Asset, hold it on a Testnet Legacy wallet and talk to the other holders from Chat. IoT is for devices.
OpenNeurai Wallet
A token-gated, encrypted conversation per DePIN token, with its own chat identity.
Learn moreDevices
ESP32 boards running the NeuraiHW firmware keep their DePIN chat identity on the device.
Learn moreRPC
Token management
-
checkdepinvalidityIs an address an active holder? -
listdepinholdersHolders of a DePIN token. -
freezedepin / unfreezedepinOwner freezes or restores a holder. -
selfrevokedepinA holder burns its own token. -
opendepin / closedepin / sealdepinTransfer state of a token. Sealing is permanent.
RPC
Messaging
-
depingetmsginfoPool status; protocol must be 2. -
depinchallengeGet a challenge to prove an address. -
depinsubmitmsgPublish an encrypted, signed message. -
depinreceivemsgFetch messages for a token and address. -
depinlistsectionsSections under a token. -
depinpoolstatsPool statistics.
The public proxies limit DePIN calls to 60 per minute per IP. The testnet DePIN endpoint is
https://rpc-testnet-depin.neurai.org/rpc.
For developers
Read messages with neurai-depin-msg
The library decrypts and verifies messages; your app supplies the RPC transport. Check the reset testnet
genesis first, and derive DePIN keys with the xna-legacy-test network of neurai-key.
import { decodeDepinReceiveResponse } from "@neuraiproject/neurai-depin-msg";
// rpcResult = depinreceivemsg(token, address, 0, "", 25)
const { messages } = await decodeDepinReceiveResponse(rpcResult, {
network: "test",
privateKey: userWif,
requestedToken: "&NEWS",
});
for (const m of messages) {
if (m.ok && m.plaintext !== null) console.log(m.message.sender, m.plaintext);
}