VOIX for developers (testnet only)
Developers12.5.9+

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.

Warning

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 #

PartState
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 #

Shell
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/stats

sendmessage 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 #

AreaCommands
Messagessendmessage, sendannouncement, listmessages, readmessage, deletemessage, voixcontacts, getvoixinfo
Phone bookbookpublish, bookendorse, bookrevoke, booklink, bookident, bookbind, bookget
Namesnameinfo, 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 #

RouteAnswer
GET /api/v1/voice/stats, voice/messages, voice/inbox, voice/sealed, voice/keysIndexed 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/nodeThe phone book
GET /api/v1/book/name/<name>, book/names, book/name-commitmentThe name registry: status, prices (renew_price_sats), names_active
GET /api/v1/voice/relays, POST voice/onion, POST voice/mailboxThe 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.

Source share/www/docs/voix-dev.md in the lotusd repository
Checked against doc/protocols/voix.md doc/protocols/book.md src/rpc/voix.cpp src/rpc/book.cpp src/rpc/names.cpp src/voix/node.h src/modules/voix/voix_module.cpp src/modules/book/book_module.cpp src/api/voice_onion_handler.cpp doc/release-notes/release-notes-12.5.9.md