Skip to content

UseCases_tokens_Drop token mint capability.md

FornaxA edited this page Aug 21, 2019 · 4 revisions

Use Cases, Scenario’s, Walkthroughts - for tokens

back to main page

Case "Drop token mint capability"

Scenario: Create and distribute the XDM token according to the IEO

Feature: Dropping token authorities

Actor: Token authority owners

Summary:

Unlike with the ION native tokens (ION and xION), user tokens cannot be created through staking. However, when one has the correct authority (a 'mint authority' for that specific token), a user can create new user tokens through direct minting using the minttoken command.

When creating a new token group (see e.g. Create management tokens), the token creator receives two token coins:

  • A token authority coin
  • A token mint coin

The token authority coin initially has all current authorities enabled for that specific token group:

  • Mint: create new tokens
  • Melt: destroy tokens
  • Child: create new authority coins
  • Rescript: (reserved) allow changing scripts (contract) connected to token coins
  • Subgroup create token subgroups

The token mint coin is an output of a transaction that has more tokens coming out of a transaction than going into the transaction: the transaction creates new tokens. A user is only able to create a token mint transaction when they own a token mint authority for that specific token group.

This use case describes scanning the blockchain for token mint authorities for a specific coin, dropping token authorities (here: dropping the token mint authority) and verifying that the chain no longer holds a mint authority for a specific coin.

The command to use is:

  • droptokenauthorities [TOKENGROUPID] [TRANSACTIONID] [OUTPUTNR] [authorityflag1] (authorityflag2) (authorityflag..): drop the specified authorities from the authority output of the specified tokengroup located at the specified transaction output.

To drop the mint authority, mint should be specified in the list of authority flag parameters.

The current case is written for dropping the mint authority for DarkMatter, but can be generalized to dropping any authority for any token group.

Preconditions:

  • The token group has been created and the needed tokens have been minted.

Steps:

DarkMatter is a token that should have a provable max of 71000 XDM. To set and verify this limit, follow the steps below.

Look up the token group ID of DarkMatter

$ tokeninfo ticker XDM
[
  {
    "groupIdentifier": "ionrt1zd4eqkzw580qqftdax8qaq5spdce6ds9zhe7567epd5r3a53r9sqc9tz0tw",
    "txid": "18251f19739a5013681d3becc9c523ebee374f8b0410d3cc8d073078a6d56b68",
    "ticker": "XDM",
    "name": "DarkMatter",
    "decimalPos": 13,
    "URL": "https://www.darkmatter.info/",
    "documentHash": "0000000000000000000000000000000000000000000000000000000000000000"
  }
]

Scan the blockchain for token authorities for DarkMatter

$ scantokens start ionrt1zd4eqkzw580qqftdax8qaq5spdce6ds9zhe7567epd5r3a53r9sqc9tz0tw
{
  "success": 1,
  "searched_items": 553,
  "unspents": [
    {
      "txid": "285994e794a299013a55b3797d7296c5de68f46dbcd605218a16d2983dba0a17",
      "vout": 1,
      "address": "g9cD8fBPBvECUL2s7FSiKkbwS9SjGGH1Pn",
      "scriptPubKey": "206b90584ea1de00256de98e0e82900b719d360515f3ea6bd90b6838f69119600c0800000000000000fcb6757576a9144ad6371453d3daeb613a202266219fe66949f23788ac",
      "ION_amount": 0.00000001,
      "token_authorities": "mint melt child rescript subgroup configure",
      "height": 355
    },
    {
      "txid": "98fee7bb8c9c3e903203cd412e9dd6b5949d61d9e5647c2d6441d805819531fd",
      "vout": 0,
      "address": "gPQrewF6LJdno63tmTXwjmqDVrzMsPhdxj",
      "scriptPubKey": "206b90584ea1de00256de98e0e82900b719d360515f3ea6bd90b6838f69119600c08000087fe3c6dda09b6757576a914e2424e6f68bcee00715ef7257479c5a68267914388ac",
      "ION_amount": 0.00000001,
      "token_amount": 71000.0000000000000,
      "height": 355
    }
  ],
  "total_amount": 71000.0000000000000,
  "token_authorities": "mint melt child rescript subgroup configure"
}

The scantokens command returns:

  • All coins that are tokens
  • All coins that are token authorities
  • The total amount of tokens
  • The aggregated set of token authorities

The above resuls show that there is 1 coin that is a token authority (285994e794a299013a55b3797d7296c5de68f46dbcd605218a16d2983dba0a17:0), and this coin has all possible authoritities (mint, melt, child, rescript, subgroup).

Identify coins in our wallet that hold DarkMatter token authorities

The command to list coins in our wallet that hold token authorities is: listtokenauthorities (TOKENGROUPID) (IONADDRESS). List all DarkMatter authorities that we own using the command:

$ listtokenauthorities ionrt1zd4eqkzw580qqftdax8qaq5spdce6ds9zhe7567epd5r3a53r9sqc9tz0tw
[
  {
    "groupIdentifier": "ionrt1zd4eqkzw580qqftdax8qaq5spdce6ds9zhe7567epd5r3a53r9sqc9tz0tw",
    "txid": "285994e794a299013a55b3797d7296c5de68f46dbcd605218a16d2983dba0a17",
    "vout": 1,
    "address": "g9cD8fBPBvECUL2s7FSiKkbwS9SjGGH1Pn",
    "token_authorities": "mint melt child rescript subgroup configure"
  }
]

This shows that the only token authority on the blockchain is in our wallet.

Explicitly drop authorities from a token authority coin

Call the droptokenauthorities command on the tokengroup ID for DarkMatter, and explicitly provide the transactionhash and transaction output number of the token authority that you want to alter. Also provide which token authority flags to drop; when specifying all existing flags or when specifying all, the complete authority will be removed.

In the case of DarkMatter, we want to remove the mint authority and the configure authority.

$ droptokenauthorities ionrt1zd4eqkzw580qqftdax8qaq5spdce6ds9zhe7567epd5r3a53r9sqc9tz0tw 285994e794a299013a55b3797d7296c5de68f46dbcd605218a16d2983dba0a17 1 mint configure

{
  "groupIdentifier": "ionrt1zd4eqkzw580qqftdax8qaq5spdce6ds9zhe7567epd5r3a53r9sqc9tz0tw",
  "transaction": "285994e794a299013a55b3797d7296c5de68f46dbcd605218a16d2983dba0a17",
  "vout": 1,
  "coin": "COutput(285994e794a299013a55b3797d7296c5de68f46dbcd605218a16d2983dba0a17, 1, 1) [0.00000001]",
  "script": "6b90584ea1de00256de98e0e82900b719d360515f3ea6bd90b6838f69119600c 00000000000000fc OP_GROUP OP_DROP OP_DROP OP_DUP OP_HASH160 c4e69bf63f95a9e7845a63f6c29d9875dfc52675 OP_EQUALVERIFY OP_CHECKSIG",
  "destination": "gLjdD9DcjwGRhkRNnUuM6euSobFMNPdpLf",
  "token_authorities": "mint melt child rescript subgroup configure",
  "authorities_to_keep": "melt child rescript subgroup"
}

Verify the new authorities To verify that there are no token mint authorities for DarkMatter on the blockchain, run the scan command again:

$ scantokens start ionrt1zd4eqkzw580qqftdax8qaq5spdce6ds9zhe7567epd5r3a53r9sqc9tz0tw
{
  "success": 1,
  "searched_items": 553,
  "unspents": [
    {
      "txid": "be87f64520882eb81cb8d7fef551489e20e0f54a2864eb5f830dba362329dfa2",
      "vout": 0,
      "address": "g9cD8fBPBvECUL2s7FSiKkbwS9SjGGH1Pn",
      "scriptPubKey": "206b90584ea1de00256de98e0e82900b719d360515f3ea6bd90b6838f69119600c0800000000000000fcb6757576a9144ad6371453d3daeb613a202266219fe66949f23788ac",
      "ION_amount": 0.00000001,
      "token_authorities": "melt child rescript subgroup",
      "height": 355
    },
    {
      "txid": "98fee7bb8c9c3e903203cd412e9dd6b5949d61d9e5647c2d6441d805819531fd",
      "vout": 0,
      "address": "gPQrewF6LJdno63tmTXwjmqDVrzMsPhdxj",
      "scriptPubKey": "206b90584ea1de00256de98e0e82900b719d360515f3ea6bd90b6838f69119600c08000087fe3c6dda09b6757576a914e2424e6f68bcee00715ef7257479c5a68267914388ac",
      "ION_amount": 0.00000001,
      "token_amount": 71000.0000000000000,
      "height": 355
    }
  ],
  "total_amount": 71000.0000000000000,
  "token_authorities": "melt child rescript subgroup"
}

In this case, there is 1 token authority for DarkMatter, and it does not include the mint authority nor the configure authority.

Postconditions:

  • The only DarkMatter authority on the blockchain does not have a mint authority

Related use cases:

ION coin Qt and Daemon Info

Builds

HOW TO: Compile iond Daemon from source

HOW TO: Compile the ION QT wallet on Ubuntu

Snapcraft installs

Install ION client in a snap

Upgrade

HOW TO: Upgrade to ION 5.0

ION Masternodes

ION Masternode FAQ

HOW TO: ION 5.0 Masternode Quickstart Guide

HOW TO: Setup ION 5.0 remote Masternode with Ubuntu remote and local QT wallet(DASH-Rebase)

ION coincore QT wallet ELECTRON MINING

Mining ION coin ELECTRON tokens with Proof of Work

ionomy Sharenodes

ionomy Zendesk hosted Sharenodes and dedicated Masternodes FAQ

ION Chain Token System

Atomic Token Protocol (ATP) Overview

ION Token system Basic Operations

UseCases tokens Create-New-Token

UseCases tokens Send-tokens

UseCases tokens Token-balance

UseCases tokens View-token-information

Testing ION tokens on regtest

UseCases regtest Start-regtest

UseCases regtest Access Token Management Key

ION Token group management

UseCases tokens Key-rotation-with-token-authorities

Create and distribute the XDM token according to the IEO

UseCases tokens Create-Management-Tokens

UseCases tokens Drop-token-mint-capability

UseCases tokens Find-token-authorities

General FAQ

How to backup my wallet and its data

How to: backup ION coin blockchain database

HOW TO: Export Private Keys from ION QT

HOW TO: Import private key to ION 3.0 Wallet

How to generate an onion privacy address

Multisend

User-Documentation

Accounts-Explained

ION-coin-Data-Directory

Raw-Transactions

Running-ION

Gitian

Gitian Building

Gitian-building-create-VM-Debian

Gitian-building-create-Debian-VMware

Gitian-building-create-VM-Fedora

Gitian-building-setup-Gitian-Debian

Gitian-building-setup-Gitian-Debian-Google-Console

Gitian-building-setup-Gitian-Debian-Google-Console-Create-instance-template

Gitian-building-setup-Gitian-Debian-Google-Console-Create-VM-from-template

Gitian-building-setup-Gitian-Fedora

Zerocoin

HOW TO: Convert Zerocoin xION to ION

How to: Backup and restore xION Zerocoin private seed

Developer-Documentation

API-Calls-List

API-Reference-JSON-RPC

Weekly Play to Win ION coin mobile gaming tournaments

How do I get involved

ionomy extra info

XDM DarkMatter IEO

ionomy Support Help Centre

ionomy web links and info

ION coin Technical Whitepaper

ion coin Bounty Procedures

ionomy Bounty Information

ionomy ION current events

Clone this wiki locally