17

I would really love to use a stellar token for a game to track e.g. ownership of different areas/land?

Is this possible with stellar?

2 Answers 2

20

Yes. You will have to create a separate asset for each item (kitty/land/area). The key part is that you currently can't change number of decimal places for assets on Stellar which are, by default, divisible to 7 decimal places. If you want your asset to be non-divisible, 0.0000001 of your asset will represent a single item. You will have to present it correctly in your user interface.

Examples

Divisible asset (ex. area/land)

If you want to allow your users to send a fraction of unit of your item (up to 1/10,000,000) you don't have to do anything special in your user interface as they are divisible by default in Stellar. You can create a new issuing account and send the following assets to your distribution account:

  • 1 LAND1
  • 1 LAND2
  • 1 LAND3

Then you can create a new offer to sell part of your land like: Sell 0.5 LAND1 Buy 1000 XLM.

Non-divisible asset (ex. kittens)

Things get a little more complicated for non-divisible assets because you need to update your user interface to interpret 0.0000001 of your asset as a single item. Again, you can create a new issuing account but this time you only send 0.0000001 of each asset what represents a single item:

  • 0.0000001 KITTEN1
  • 0.0000001 KITTEN2
  • 0.0000001 KITTEN3

Now, because assets on Stellar are divisible only to 7 decimal places you can't send/sell a part of 1 kitten (this would hurt!). So creating a following offer: Sell 0.0000001 KITTEN1 Buy 1,000 XLM means you are selling KITTEN1 for 1,000 XLM.

Useful links

3
  • its a planet as big as our earth.. and tracking each square meter by creating a token for every single square meter seems to be too complicated and will lead to other issues ;)
    – kannix
    Jan 25, 2018 at 10:52
  • @kannix From the code point of view I don't think it complicate things much as it falls under "Non-divisible asset". However there is an obvious scalability issue here. Earth surface area is 510.1 trillion m2. (according to Google). So if you used only 1 byte for each square meter (and it's obviously not enough to store all the ownership info) you'd need 510 TB of storage. I don't any blockchain solution out there can handle this. Even centralised solution for such application isn't trivial. Jan 25, 2018 at 11:25
  • @BartekNowotarski do you have a feel for how many LAND* assets could be currently supported from a single issuing account in Stellar? I'm concerned about the scalability of things like trustlines and Stellar.toml. For the use-case above, we'd potentially want thousands or millions of LAND Assets.
    – Symmetric
    Apr 18, 2018 at 16:37
6

Short answer: right now it's not possible as the way assets are represented is done using trust lines that by design don't distinguish between tokens.

Convoluted answer: you could do it by issuing an asset per unique token (and you would issue only 1 of each). From a data set point of view it's workable (you would use the ASSET_TYPE_CREDIT_ALPHANUM12 asset type), where this solution breaks down is on usability as transferring tokens would require creating a trust line per token. For somebody to transfer a token to somebody else, the parties would have to cooperate on a multi-sig transaction that does something like:

  1. operation1 - create trustline in destination account
  2. operation2 - send 1 token to destination
  3. operation3 - delete trustline in source account

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.