What Are the Secret Powers of Authz and Fee Grant Modules?

Written by cosmosnetwork | Published 2022/07/08
Tech Story Tags: cosmos | cosmos-network | cosmos-ecosystem | authz | cosmos-sdk | future-of-authorizations | good-company | technology

TLDRThe modular design of the Cosmos SDK is one of its most powerful features. As the SDK upgrades and improves, exciting new features are introduced to the Cosmos stack as modules, similar to how the International Space Station was improved with amazing functionality over time. Blockchains in the Cosmos ecosystem and their end users are excited to adopt new upgrades to the SDK, but at times aren’t fully aware of the huge benefits some of these modules can provide. In light of that, we’d like to highlight two highly powerful modules that were part of the v0.43 release last year: Authz & Fee Grant.via the TL;DR App

The modular design of the Cosmos SDK is one of its most powerful features.

As the SDK upgrades and improves, exciting new features are introduced to the Cosmos stack as modules, similar to how the International Space Station was improved with amazing functionality over time.

Blockchains in the Cosmos ecosystem and their end users are excited to adopt new upgrades to the SDK, but at times aren’t fully aware of the huge benefits some of these modules can provide.

In light of that, we’d like to highlight two highly powerful modules that were part of the v0.43 release last year: Authz & Fee Grant.

Cosmos SDK Authz Module

Short for AuthorizationAuthz allows you to authorize an address to perform a specific action on your behalf.

Imagine you have a wallet with a lot of funds stored on it but there are regular transactions you might need to perform, like voting on governance proposals or claiming your staking rewards. You might get a bit annoyed each time you have to connect your Ledger or try to access your wallet in cold storage and, understandably so, you’d prefer to just use a browser wallet like Keplr whenever possible.

With Authz, you can authorize a different address to perform these specific transactions for you, without worrying that this address will be able to take any other actions with your funds. This effectively allows you to perform your regular activities without worrying about compromising your valuable wallet.

App developers can also create their own custom authorization types for their own SDK modules. You are welcome to read the full technical specification here.

Cosmos SDK Fee Grant Module

In many ways, the Fee Grant module can be seen as a companion to Authz. This module enables users to grant other people an allowance to be used to pay for gas fees, without actually transferring any tokens to the other address. The beauty here lies in the fact that the funds remain in control of the user who created the allowance.

Imagine you are building the next best NFT marketplace using the Cosmos SDK. You might be worried about user adoption knowing people will have to buy your token on an exchange just to pay gas fees on the platform — a significant barrier to entry for new blockchain users though generally fine for users who have already been onboarded to the ecosystem.

With the Fee Grant module, you can create an allowance for new users so that they can start using your application without worrying about gas, streamlining the onboarding to your dApp. It’s a much better alternative than directly sending tokens to new users because you don’t have to worry about tokens being used for anything other than gas fees, and unused tokens are never wasted.

In fact, you can even find a great example of this in the wild right now! OmniFlix is currently using Fee Grant to both pay for the fees of new users on their platform, and to cover the fees relayers incur when transferring tokens and data over the Inter Blockchain Protocol. Allowing them to launch their platform without actually needing their native token to be liquid and available to users just yet.

These Fee Grant allowances can be a one time grant that gets depleted or a recurring grant that refills at specified intervals. As with the Authz module, these allowances and permissions can be revoked at any time, but in the case of the Fee Grant module, they can have an expiration date too.

The full technical specification of the Cosmos SDK Fee Grant module is available here.

The Future of Authorizations

Many Cosmos blockchains have already implemented these powerful features, including the Cosmos Hub. However, the end user friendly UI/UX tooling around them is mostly still in the works.

We’re seeing great progress being made on an Authz web interface in development by Adoriasoft (funded by the Interchain Foundation) and we’re excited to see what other front-end developers and wallets providers come up with as they’re working hard to build the interfaces that enable everyone to use the full power of AuthZ and Fee Grant!

Many more use cases than the few described in this blog post do exist and we encourage you to explore all potential possibilities available to users.

If you’re a builder and would like to experiment with these modules, we have some great tutorials up on the Cosmos Developer Portal as well as a vibrant community on Discord that is happy to answer any questions you might have!


Written by cosmosnetwork | The open, scalable, and interconnected economy of the future. $ATOM
Published by HackerNoon on 2022/07/08