Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balance/Denom credit design #117

Closed
aaronc opened this issue Oct 28, 2020 · 4 comments
Closed

Balance/Denom credit design #117

aaronc opened this issue Oct 28, 2020 · 4 comments

Comments

@aaronc
Copy link
Member

aaronc commented Oct 28, 2020

Summary

This proposes an architecture for ecosystem service credits (#107) based on the existing Cosmos SDK x/bank and x/ibc/applications/transfer Coin model.

Problem Definition

See #107

Proposal

This is based off of work done in https://github.com/regen-network/reDAOmint/tree/reDAOmint/x/ecocredit and updated to actually use an updated x/bank under the hood.

In ADR 001 a convention for modules defining a "namespace" of denom identifiers is outlined.

We define a denom identifier for a credit batch as: fmt.Sprintf("ecs/%s/%s", classId, batchId) where classId are batchId unique string identifiers for the credit class and batch.

The ecs (ecosystem-service credit) module, defines the following Msgs for creating credit classes and batches, and retiring credits:

service Msg {
  rpc CreateClass(MsgCreateClass) returns (MsgCreateClassResponse);
  rpc CreateBatch(MsgCreateBatch) returns (MsgCreateBatchResponse);
  rpc Retire(MsgRetire) returns (MsgRetireResponse);
}

message MsgCreateClass {
  string designer;
  repeated string issuers;
  bytes metadata;
}

message MsgCreateClassResponse {
  string class_id;
}

message MsgCreateBatch {
  string issuer;
  string class_id;
  repeated BatchIssuance issuance;
}

message MsgCreateBatchResponse {
  string batch_denom;
}

message BatchIssuance {
  string recipient;
  string tradeable_units;
  string retired_units;
}

message MsgRetire {
  string holder;
  repeated cosmos.base.Coin credits;
}

message MsgRetireResponse { } 

Consequences

Pros

  • integrates smoothly with existing Cosmos paradigm (sdk.Coin, x/bank and IBC transfer)

Cons

Neutral

  • the ecs module will need to track balances of retired/burned coins
@robert-zaremba
Copy link
Collaborator

I didn't go through all details of the x/bank changes you propose, but instead of extending it, how about creating a new module which will extend it? With that we will keep x/bank minimal.

@robert-zaremba
Copy link
Collaborator

robert-zaremba commented Oct 28, 2020

That new module could do things like: checked transfers / whitelisting, compliance etc...

@aaronc
Copy link
Member Author

aaronc commented Oct 28, 2020

Some of the changes I'm suggesting to x/bank are relatively minor or should be done anyway IMHO. The ocaps stuff allows better encapsulation so other module can manage more rules based stuff like transfers/whitelisting on top of bank. I agree x/bank should be minimal.

@robert-zaremba
Copy link
Collaborator

It seams that #125 supersedes this issue, and it will be easier to keep discussion in one place. Shall we remove this issue , and other references to this issue (to keep focus in one place)? You can add Consequences section to a README file or to a PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants