We're already able to develop some prototype of transaction with Linera SDK, but we still lack of sense about Linera native token mechanism, what will it like?

For now I think we already had some knowledge about Linera microchain, application, smart contract. But we still lack of knowledge about the Linera Token mechanism. What I would like to learn is not about the economics, or consensus, but more about the implementation. Because I still cannot imagine how will the Linera Native Token be implemented with the microchain architecture. Did anyone know about that ?

7 Likes

Every Linera system has a special ā€œadminā€ chain already to manage the voting rights of validators. We are currently implementing the protocol for the admin chain to be ā€œpublicā€, that is, managed by the validators ā€“ as opposed to being a ā€œuser chainā€ in the current implementation.

For other aspects of Linera governance, such as managing the native token, we plan to use a similar setup with the same ā€œadminā€ chain or another one. Governance will likely be programmed in native Rust rather than Rust/Wasm for efficiency reasons. They will be special logic for rewarding validators in function of their stakes, etc.

4 Likes

Understood.

As I know currently assets of each microchain(or application ?) will not be synced to other microchain (please correct me if Iā€™m wrong, :smile:). But I think in a production scenario we still have to keep some global state in different microchain.

For example, if I would like to query the native token balance of an address in one microchain, may be I would like to get its global balance but not only on this microchain.

Could you please also explain something about that ?

4 Likes

I imagine most users will keep their tokens on only one chain.

Maybe sometimes one or two other chains that they interact with. But there shouldnā€™t be a need to scan the whole system and check every microchain to look whether they have tokens there.

Thereā€™s no concept of a ā€œglobal balanceā€ in the system: Every token is on only one chain at any given time.

4 Likes

So for native token, per @ma2bd 's discussion, itā€™ll be managed with ā€˜adminā€™ chain ? If another chain need the native token balance, should it check with ā€˜adminā€™ chain ?

And for the deposit scenario such as dex, when the native tokens are transferred to dex address, itā€™ll be recorded in ā€˜adminā€™ chain, and the dex application should record the deposit share of each address ? Do I understand right ?

1 Like

No, itā€™ll actually be called the native token on every chain.

In the dex scenario, the admin chain would not be involved:

  • Say your chain has a (native token) balance 3.
  • You submit a Transfer operation to your chain to send 2 tokens to the dex chain. That decreases your balance to 1 and sends a message to the dex chain containing the 2 tokens.
  • The dex chain includes the incoming message in a block and increases its balance by 2.

Thatā€™s safe because all chains are managed by the same set of validators and they ensure that they all follow the same rules: no chain can double-spend or freely mint tokens, every received message has actually been sent, and can only be received once.

2 Likes

No, itā€™ll actually be called the native token on every chain.

=> For example, we have ETH on ethereum which will be used as gas globally for ethereum chain. Will that be the same on Linera ?

1 Like

Yes. Generally speaking, Linera microchains are used to structure computation and blockspace but are not sovereign in any way (same validators, same native token, same gas mechanisms).

2 Likes

Do you mean there wonā€™t have a native token in Linera like ETH for ethereum ? Any application which would like to deployed with Linera will need to create its own native token, right ?

1 Like

:heart_eyes: nice work nice worknice worknice worknice work

1 Like

The microchain is more likely to be like our backpack, I think, heā€™s like a chain that will have two chains synchronized on it, one accessible to the public, and the other one is more like independent, theyā€™re synchronized in the display, one public, one for ourselves. Itā€™s more like a big tree, you know, heā€™ll extend a lot of branches and leaves, but his main body is unchanged, I think thatā€™s my understanding.

1 Like

No, there will be one native Linera token. Itā€™s just not tied to any particular microchain. It can be freely sent from one chain to another.

Applications will be able to use it, too. (We might expose it via the same interface as the fungible app, or something similar.)

1 Like

yeah. thatā€™s what i would like to be clear about. some questions i would like to understand:

1 will this token be used as gas in Linera chain ?
2 can i get account balance of this token on any microchain ?
3 if some amount of this token is sent to an account, will the application on microchain be notified ?
4 can this native token be sent to an application (like ethereum to be sent to smart contract address) ?

sorry so many questions, :smile:

  1. Yes (probably)
  2. Yes, but itā€™s different on every chain. You should rather think of every chain as a different account, even if you can access them using the same key.
  3. I donā€™t think thatā€™s decided in detail yet. I imagine we wonā€™t have an additional contract API function for handling incoming transfers. Maybe youā€™ll be able to send along tokens with a message; or it might work via two separate messages, like with the fungible+crowd_funding examples (with the native token instead).
  4. Probably yes.

Weā€™ll have more definite answers to those questions soon. But Iā€™m pretty sure we will support all the use cases for applications using tokens. You should be able to do anything you can do on other blockchains in that respect.

3 Likes

There are several options but so far the most elegant one IMHO is that the native token has an application ID and a similar ABI as any user token (created by instantiating the fungible-token code in Wasm).

2 Likes

Great, great. Canā€™t wait for the native token implementation and try.

1 Like

Looking forward to the arrival of the test network

We now have a native fungible token app in the examples on the main branch.

The next step would be to pre-deploy the app in testing network. (This is not strictly necessary but would make it easier on people.)

Read the code here linera-protocol/linera-sdk/src/abis/fungible.rs at main Ā· linera-io/linera-protocol Ā· GitHub and understood the token mode of Linera, :smile:. I note in the Operation::Transfer, Account is used as target_account. Itā€™s contain chainId and AccountOwner.

Just has some curious: If someday we have some probability (or thatā€™s nonsense ? :smile:, feel free to correct me) to use Linera browser node service as a data provider of exist wallet such as metamask, how to let metamask know about Linera account ?

1 Like

Ok so that is a different question but we have some ideas to make Ethereum addresses usable for Linera accounts.

On top of that, if we want to make it really easy to transfer funds to a Linera account from another chain, it would be useful to have a notion of ā€œdefault microchainā€ for each Linera account.

2 Likes