VOIX for developers (testnet only)
VOIX messaging is in lotusd 12.5.9 but off by default, and sending is refused on mainnet: what you can try on regtest and testnet, the RPCs, the REST routes and the formats.
Do not build a mainnet product on VOIX yet. In 12.5.9 it ships off by default (-voix=0), and every send on mainnet (RPC, web wallet, Lotus Desktop, the browser library) is refused with voix_review_pending until the review of its P2P, onion and mailbox code is done. Dry runs work everywhere. The formats may still change before mainnet. Use regtest and testnet to experiment.
VOIX is messaging on Lotus: public announcements weighed by the coins they burn, directed messages (in clear or sealed to the recipient's key) that pay the recipient a stamp, a phone book on chain, unique names, and an onion-routed tier with mailboxes for recipients who are offline.
What runs on a 12.5.9 node #
| Part | State |
|---|---|
Indexing of VOIX and BOOK records (modules voix, book) | On, on every chain. /api/v1/voice/* and /api/v1/book/* answer |
Sending on chain (sendmessage, sendannouncement, bookpublish, ...) | Regtest and testnet: yes. Mainnet: voix_review_pending, except dry_run |
Names (namecommit, nameclaim, ...) | From the Napoleon activation (contract opcodes); before: names_not_active |
Onion relay and mailboxes (P2P voicehello, voiceonion, voicembox, ...) | Off: -voix=1 turns them on. /api/v1/voice/relays, voice/onion, voice/mailbox answer 503 voix_disabled until then |
Try it on regtest #
lotusd -regtest -daemon -txindex=1 -voix=1
lotus-cli -regtest createwallet dev
lotus-cli -regtest generatetoaddress 101 $(lotus-cli -regtest getnewaddress)
TO=$(lotus-cli -regtest getnewaddress)
lotus-cli -regtest sendmessage $TO "hello" '{"mode":"chain"}'
lotus-cli -regtest generatetoaddress 1 $(lotus-cli -regtest getnewaddress)
lotus-cli -regtest listmessages
curl -s http://127.0.0.1:12604/api/v1/voice/statssendmessage answers the record it built (record, record_size, script_size, above_223, mode, sealed, sealed_to, stamp_sats, burn_sats, fee_sats, ...). A sealed message to a wallet address shows up in listmessages of the receiving wallet after the block. above_223 tells you that the record's script would be refused by upstream nodes (Napoleon for integrators).
RPCs #
| Area | Commands |
|---|---|
| Messages | sendmessage, sendannouncement, listmessages, readmessage, deletemessage, voixcontacts, getvoixinfo |
| Phone book | bookpublish, bookendorse, bookrevoke, booklink, bookident, bookbind, bookget |
| Names | nameinfo, namelist, namecommit, nameclaim, namesettle, namerefund, namerenew, nametransfer, namerelease, namerevoke |
lotus-cli help <command> gives the arguments. getvoixinfo says send_allowed and send_refusal for the chain the node is on.
REST routes #
| Route | Answer |
|---|---|
GET /api/v1/voice/stats, voice/messages, voice/inbox, voice/sealed, voice/keys | Indexed records, the public keys seen on chain |
GET /api/v1/book/stats, book/address, book/handle, book/search, book/recent, book/subject, book/endorsements, book/entity, book/node | The phone book |
GET /api/v1/book/name/<name>, book/names, book/name-commitment | The name registry: status, prices (renew_price_sats), names_active |
GET /api/v1/voice/relays, POST voice/onion, POST voice/mailbox | The onion tier (with -voix=1) |
These routes are not in the OpenAPI document of 12.5.9.
Formats #
LOKAD id VOIX (564f4958), bare OP_RETURN or eMPP. Record types 0x01 MSG, 0x02 SEALED, 0x40 DIGEST, 0x41 RECEIPT (module voix), 0x10 to 0x15 phone book records (module book). Byte layouts and rules: VOIX messages and BOOK; test vectors in the lotusd source tree, doc/voix/vectors/.
In the browser, node.voix of lotus-node.js builds and sends onion packets and reads mailboxes; its sends are refused on mainnet the same way.
