-
Notifications
You must be signed in to change notification settings - Fork 9
How Polytone Works
Polytone is made of three modules: note, voice, and proxy.
The note says what to say, and the voice (via the sender’s proxy) says it.
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.
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.
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.
If one of the executed messages fails, all of the messages are rolled back.
Executing queries has the same semantics as executing messages. If a single query fails, all queries are canceled.