6

Is there a way to create a token with a fixed 2% annual rate of new token creation on Stellar ? Thanks

How to create a token on the stellar network?

3
  • Just print 20,000 tokens each year using the same issuer account if it's not locked.
    – Kuyawa
    Mar 29, 2018 at 20:55
  • @RubberDucky you're right. Would be great to merge them if possible (I haven't seen such option on SE). Mar 30, 2018 at 18:52
  • Merging is possible but I think that, at this time, it is better to leave this marked as a duplicate.
    – Chenmunka
    Apr 20, 2018 at 10:24

2 Answers 2

5

Yes. Let's assume that you already have an issuing account (I) and distribution account (D) and you've issued 1,000,000 CANDYs. Let's see how a transaction that generates 2% of new tokens after 1st year looks like:


Send inflation after 1st year:

  • Source account: I
  • Sequence number: current + 1
  • Min time: now + 1 year
  • Operations:
    • Payment: 2% (inflation rate) * 1,000,000 (current supply) = 20,000 CANDY to D.

In the simplest version you'd just generate a bunch of transaction for the following years with updated sequence number, min time and payment amounts. However, a person that holds the secret key of I is still able to submit any other transaction at any time. They can change the inflation rate to 5% or even remove inflation (by blocking the account from making any transactions in a future)!

To prevent from this we can use Pre-authorized Transactions concept. This will allow only certain transactions to be accepted by the network.

To do this we need to:

  • Calculate the hashes of transaction that send inflation.
  • Create and submit a transaction that configures the account to only accept a transaction sending inflation after the 1st year.

Send inflation after 1st year:

  • Source account: I
  • Sequence number: current + 2
  • Min time: now + 1 year
  • Operations:
    • Payment: 2% (inflation rate) * 1,000,000 (current supply) = 20,000 CANDY to D.
    • Set Options: hash of transaction sending inflation after 2nd year.

Configure account:

  • Source account: I
  • Sequence number: current + 1
  • Operations:
    • Set Options: hash of transaction sending inflation after 1st year (the one above).

As you can see for payment after X-th year we need a hash of a transaction that sends inflation after year X+1-th. Because of this we need to create transactions in a reverse order. We also need to specify number of years we want our account to pay an inflation.

So to sum it up, you create the set of following transactions:


Send inflation after X-th year:

  • Source account: I
  • Sequence number: current + 1 + X
  • Min time: now + X years
  • Operations:
    • Payment: 2% (inflation rate) * supply after X-1 to D.
    • Set Options: hash of transaction sending inflation after X+1-th year.

And of course you still need to submit the first transaction that configures the account.

It may be a great idea to test it in test network with a time frame of, say, 10 minutes to check if everything runs correctly.

1
2

There is no on-ledger method of creating this at this time. The features of "fees" and "inflation" are currently reserved exclusively for XLM. There is also no native system to host or describe this 'rate' and submit txns for you. The mechanism and code to create and submit these transactions must be from provided outside of the Stellar infrastructure at this time.

The two options are (1) leave the Issuer account unlocked and issue new tokens at a regular rate, and (2) Issue all the tokens immediately to an inflation distribution account and deliver them out at a regular rate from there.

In principle, the two procedures are identical, there's an account that acts as the source of new tokens and you submit transactions to have that account make payments according to your preferred schedule.

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