cosmos / cosmos-sdk

:chains: A Framework for Building High Value Public Blockchains :sparkles:
https://cosmos.network/
Apache License 2.0
6.18k stars 3.58k forks source link

[Feature]: Extend x/authz #20136

Open trevormil opened 4 months ago

trevormil commented 4 months ago

Summary

Many applications could benefit from an extension to the x/authz module which supports two-way authorizations. For example, I approve Msgs A, B, and C to be executed if the counterparty agrees to execute Msgs 1, 2, and 3.

For example, this would allow a Seaport-like implementation natively in Cosmos without any extra overhead. I will trade you this NFT + 10 $ATOM for that NFT.

Problem Definition

No response

Proposed Feature

The proposed feature would be a standalone module (or an extenstion to x/authz) which supports two-way multi-msg transactions authorizations that can be accepted by the counterparty.

Two things would need to happen to extend x/authz: -Support multi-msg grants (I believe authz is only currently one now) -Get a system where you can denote who the initiator of each Msg is expected to be. It is not always the granter (the counterparty initiates some transactions).

hieuvubk commented 4 months ago

Is this just about grant multi msg?

trevormil commented 4 months ago

Is this just about grant multi msg?

I'm not sure if grant multi msg would enable such use cases (to be honest, I don't know all the behind the scenes). The big difference though is that you can initiate Msgs on behalf of the counterparty as well, not just yourself. A two-way multi-transaction, if you want to think of it like that.

For example, Bob approves Alice to transfer 1 NFT ID 123 (tx initiated by Bob) if Alice transfers NFT ID XYZ (tx initiated by Alice). The big difference is who the initiator of the transcations are.