Skip to content

How Polytone Works

ekez edited this page Apr 18, 2023 · 1 revision

Polytone is made of three modules: note, voice, and proxy.

image

The note says what to say, and the voice (via the sender’s proxy) says it.

image

Connecting Note & Voice

Different blockchains have different encodings and message types, in Polytone we call these “extensions”. For a note to connect to a voice, the voice must support all extensions the note does; The voice must be able to say everything the note can speak.

image

Once a note has connected to a voice, it is “paired”. Once paired, the note will only ever connect with that voice, even if the first channel to connect them closes. Pairing simplifies Polytone’s API, as message senders don’t need to specify the channel to send on.

image

Executing Messages

To execute messages, the messages are sent to the note, which relays them to its voice, which relays them to the sender’s proxy. If the sender has no proxy, a new one is created before relaying the messages.

image

If one of the executed messages fails, all of the messages are rolled back.

image

Executing queries has the same semantics as executing messages. If a single query fails, all queries are canceled.