Building the Toqen Platform

So how can we create these “toqens” (token blockchains running on Qubic)? The idea is to implement a Toqen Platform, a decentralized system that simulates multiple of these blockchains.

First Component: The Toqen API

To allow other qubics to utilze this service, we need some sort of API, an interface where qubics can:

request the creation of a new toqen¹

send transactions on the blockchain of an existing toqen

conceptual design of a toqen platform (graphic by Qyvxz)

This Toqen API is the first of the two modules we need. It will be a qubic that searches through the tangle to pick up any API calls. Having done that, it filters out all invalid calls (e.g. transactions with an invalid signature, or transactions of toqens that do not exist). The API manages a record of all existing toqens (the toqen list). It also picks the N (a constant integer ≥ 1) transactions with the highest priority² out of the transaction pool for further processing. Both the toqen list, as well as the picked transactions are the output of this qubic and are written onto the tangle, from where they can be used as input for the second component (another qubic) of our Toqen Platform.

Second Component: The Toqen Chain

Now that we have the API in place to create new toqens and filter out the transactions with the highest priority, we can finally do the interesting part: the block creation. This will be done by the Toqen Chain, a second qubic that manages the ledgers of each individual toqen. To do this, it switches ledgers after each epoch (qubics work in rounds called “epoches”).

the Toqen Chain creates a new block every epoch (graphic by Qyvxz)

This way, it will create a block for toqen A, thereafter a block for toqen B, then C and so on, until it reaches the last toqen, before switching back to A and repeating that circle. Since all toqens are listed in the toqen list, it knows all of them.

Each toqen will receive a new block after a few epoches. As opposed to classical blockchains, the blocks in these blockchains are not bundles of confirmed transactions but snapshots of the ledger (all current accounts and their respective balances). This is necessary, as we will see in the next paragraph (although there is a simple improvement to bypass this limitation, see the section “Account Ledgers”).

Before adding the new transactions to a ledger, the Toqen Chain needs to validate the transactions it receives from the Toqen API. Validating includes checking the balances in the latest block of the ledger (therefore each block needs to contain all balances). The accepted transactions move balances on the ledger, resulting in the creation of a new block. The block is then published on the tangle where it can be seen by other entities (humans or machines checking their toqen balances) or other qubics which use the result as input (this opens entirely new possibilities, as I will outline in my next blog post).