EOSphere Blog
Published in

EOSphere Blog

WAX Technical How To #12

Your WAX account is used for all interactions with the blockchain, all actions require an associated authority which is typically your accounts active permission.

There are occasions when you may require a specific action to be executed from an external node our another party using your account, where you wouldn't want to share your active private key.

In this 12th WAX Technical How To Edition a Guild’s practical example will be walked though on claiming rewards.

WAX Account Custom Permissions

If you are after more detail EOSIO accounts and permissions are covered extensively in the eosio developers documentation.

By default a WAX account has two permissions owner and active

The owner permission sits at the root of the permission hierarchy for every account. It is therefore the highest relative permission an account can have within its permission structure. Although the owner permission can do anything a lower level permission can, it is typically used for recovery purposes when a lower permission has been compromised. As such, keys associated with the owner permission are typically kept in cold storage, not used for signing regular operations.

The implicit default permission linked to all actions is active, which sits one level below the owner permission within the hierarchy structure. As a result, the active permission can do anything the owner permission can, except changing the keys associated with the owner. The active permission is typically used for voting, transferring funds, and other account operations.

In this article a custom permission example will be walked through, this custom permission will fall under the active permission and will provide authorisation for 3 reward claiming actions claimgbmprod , claimgbmvote and claimgenesis.

Configuration Summary

  1. Create a new key-pair
  2. Create a custom permission
  3. Assign an action to the custom permission
  4. Execute the permissioned action

cleos and keosd will be used for this configuration as discussed in our previous article, Set Up a WAX Testnet Block Producer Node.

Create and import a new key-pair

***Create a new key-pair***> cleos create key --to-console
Private key: 5KdtC99C9VoZoXscoQLe77zmnVAwj3PGSb1aJVQPZBEzcseaP5n
Public key: EOS4tma83A8ocKsKsio2hpecJv16AZL4YxnoHpU2TK25r4E6UGE28
***Create a new wallet to use this key-pair***> cleos wallet create -n waxclaim --to-console
Creating wallet: waxclaim
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5JGHurUqfb2qf93Hynit3qFpkddiz6wpEWaWuqKTuGq5by4Fk7V"
***Unlock your wallet with the password from before***> cleos wallet unlock -n waxclaim
password: Unlocked: waxclaim
***Import your active_key : private***> cleos wallet import -n waxclaim
private key: imported private key for: EOS8PSfvq342YTVtogNVskjCttpx1rQX9JT59wQuLt2Nkz16ZmsL4

Create a custom permission

The below command will create a custom permission called waxclaimer, the public key is used from the above generated key-pair and it will fall under the eosphereiobp accounts active permission in this example.

Of course for your purposes you would use your own Guild account and ensure that your active permission is unlocked using cleos.

cleos -u https://wax.eosphere.io set account permission eosphereiobp waxclaimer '{"threshold":1,"keys":[{"key":"EOS4tma83A8ocKsKsio2hpecJv16AZL4YxnoHpU2TK25r4E6UGE28","weight":1}]}' "active" -p eosphereiobp@active

Assign actions to the custom permission

In the below example three actions will be assigned under the waxclaimer permission, claimgbmprod (Block Production Rewards), claimgbmvote (Voter Rewards) and claimgenesis (Genesis Rewards).

As before, for your purposes you would use your own Guild account and ensure that your active permission is unlocked using cleos.

> cleos -u https://wax.eosphere.io set action permission eosphereiobp eosio claimgbmprod waxclaimer> cleos -u https://wax.eosphere.io set action permission eosphereiobp eosio claimgbmvote waxclaimer> cleos -u https://wax.eosphere.io set action permission eosphereiobp eosio claimgenesis waxclaimer

Execute the permissioned actions

Using the waxclaimer permission and associated unlocked waxclaim wallet in this example (make sure you unlock waxclaim before use), these actions can now be executed without having to unlock and use the active permission.

The custom permission is used by specifying -p eosphereiobp@waxclaimer in the action.

> cleos -u https://wax.eosphere.io push action eosio claimgbmprod '{"owner":"eosphereiobp"}' -p eosphereiobp@waxclaimer> cleos -u https://wax.eosphere.io push action eosio claimgbmvote '{"owner":"eosphereiobp"}' -p eosphereiobp@waxclaimer> cleos -u https://wax.eosphere.io push action eosio claimgenesis '{"claimer":"eosphereiobp"}' -p eosphereiobp@waxclaimer

Be sure to ask any questions in the EOSphere Telegram

EOSphere Guild is a Block Producer on the WAX Protocol Network as well as many other EOSIO based Blockchains.

If you find our work helpful, please vote for us on the WAX Mainnet: eosphereiobp

If you prefer to proxy your vote, our proxy account is : blklotusprxy

Connect with EOSphere via these channels:

TELEGRAM | MEDIUM |YOUTUBE | FACEBOOK | TWITTER | INSTAGRAM

--

--

--

Leading Australian EOSIO Block Producer candidate serving the entire EOSphere

Recommended from Medium

DAO’s and Decentralizing Small Business Ownership; Thoughts on How to Get it Done

Smartlands Network Architecture Explained: the Validators

A Detailed Overview of the Oracles & Compliance Concept in Smartlands Network

The World Is Going Global

State Explosion and the Tragedy of the Blockchain Commons

Beyond bitcoin, why blockchain matters

How to Use a Hardware Wallet with Neuron

Ledger wallet

Nervos Looks to Empower a Shift to DeFi with $5M Grant for Blockchain and Fintech Entrepreneurs

Nervos $5 million DeFi ecosystem grant

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ross Dold

Ross Dold

Co-Founder of EOSphere Australia

More from Medium

WAX Technical How To #11

Xpansion Game Weekly Update

NFT Battle Miners : Let’s go PvP, Let’s go Metaverse. LET’S GO BIG!

Xpansion Game Weekly Update