Arcturus Docs
  • Note!
  • Bitcoin and Decentralized Structure
  • Introducing to Arcturus Chain
  • For End User
    • How to add Arcturus to Metamask
    • Obtaining tARC from the Faucet
    • Faucet API
    • How to Use Arcscan
  • For Nerds
    • Proof Of Stake
    • Arcturus Chain
      • Accounts
      • Messages and Transactions
      • Messages
      • Arcturus State Transition Function
      • Code Execution
      • Blockchain and Mining
      • Applications
        • Token Systems
        • Financial Derivatives and Stable-Value Currencies
        • Identity and Reputation Systems
        • Decentralized File Storage
        • Decentralized Autonomous Organizations
        • Further Applications
      • Fees
      • Computation And Turing-Completeness
      • Currency And Issuance
      • Mining Centralization
      • Scalability
      • Conclusion
    • Arcturus Pay
      • About
      • Technolog & Use Cases
      • Developer Instructions
        • arcpay_dev-1
        • arcpay_dev-2
        • arcpay_dev-3
  • Updates & News
Powered by GitBook
On this page
  1. For Nerds
  2. Arcturus Chain
  3. Applications

Token Systems

PreviousApplicationsNextFinancial Derivatives and Stable-Value Currencies

Last updated 10 months ago

On-blockchain token systems have many applications ranging from sub-currencies representing assets such as USD or gold to company stocks, individual tokens representing smart property, secure unforgeable coupons, and even token systems with no ties to conventional value at all, used as point systems for incentivization. Token systems are surprisingly easy to implement in Arcturus. The key point to understand is that all a currency, or token system, fundamentally is, is a database with one operation: subtract XXX units from AAA and give XXX units to BBB, with the proviso that (i) AAA had at least XXX units before the transaction and (ii) the transaction is approved by AAA. All that it takes to implement a token system is to implement this logic into a contract.

The basic code for implementing a token system in Serpent looks as follows:

def send(to, value):
    if self.storage[msg.sender] >= value:
        self.storage[msg.sender] = self.storage[msg.sender] - value
        self.storage[to] = self.storage[to] + value

This is essentially a literal implementation of the "banking system" state transition function described further above in this document. A few extra lines of code need to be added to provide for the initial step of distributing the currency units in the first place and a few other edge cases, and ideally, a function would be added to let other contracts query for the balance of an address. But that's all there is to it. Theoretically, Arcturus-based token systems acting as sub-currencies can potentially include another important feature that on-chain Bitcoin-based meta-currencies lack: the ability to pay transaction fees directly in that currency.

The way this would be implemented is that the contract would maintain an Arcturus balance with which it would refund Arcturus used to pay fees to the sender, and it would refill this balance by collecting the internal currency units that it takes in fees and reselling them in a constant running auction. Users would thus need to "activate" their accounts with Arcturus, but once the Arcturus is there it would be reusable because the contract would refund it each time.