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

Record retirement location for ecocredit module #328

Closed
clevinson opened this issue Apr 16, 2021 · 2 comments · Fixed by #384
Closed

Record retirement location for ecocredit module #328

clevinson opened this issue Apr 16, 2021 · 2 comments · Fixed by #384
Assignees
Labels
Scope: x/ecocredit Issues that update the x/ecocredit module

Comments

@clevinson
Copy link
Member

clevinson commented Apr 16, 2021

Retirement location should be stored & recorded. This should be a location of:

  • beneficiary
  • buyer

Paris Agreements require to track where we require credits (jurisdiction / sub national, eg: NY State can have different accounting than New Jearsy or New York City).
We need short, not ambiguous field for location.
We propose:

<country-code>[-<sub-national>-[<postal-code>]]

The former two are codes specified by SO_3166-2

@clevinson clevinson added this to the Mainnet Launch milestone Apr 16, 2021
@aaronc aaronc mentioned this issue Apr 16, 2021
7 tasks
@clevinson
Copy link
Member Author

Some refinement here:

  • issuance location (geopolygon) will be taken care of via shacl schemas on data module, and are out of scope for this issue, though still a requirement

Adding one field on retirement for location, it should be strings adhering to something similar to: https://en.wikipedia.org/wiki/ISO_3166-2

@clevinson clevinson removed this from the Mainnet Launch milestone May 13, 2021
@aaronc aaronc added Scope: x/ecocredit Issues that update the x/ecocredit module and removed backlog labels May 13, 2021
@aaronc aaronc added this to the v1.1 milestone May 21, 2021
@ruhatch ruhatch self-assigned this Jun 10, 2021
@ruhatch
Copy link
Contributor

ruhatch commented Jun 15, 2021

A couple of refinement questions here:

1. Should we record the location in the store?

We are going to log the location in events, so we can access location information using an index of events, but that might make quick access more difficult. In general, we'd like to store as little as possible in state, so to stick with that design principle we would err on the side of not putting locations in the store. If it's really bad for end-user experience, then we can add them into the store, and we can always do this at a later date, as it doesn't affect the actual chain.

2. Should we record locations for retired_units in MsgCreateBatch and MsgSend?

Both these messages include credit retirement during the issuance or transfer of credits from a batch. It seems we therefore need to include retirement location alongside those credit retirements, but I want to check that this is desired behaviour. Also, each MsgCreateBatch includes multiple BatchIssuances. Should there be a location per-issuance. Again, I'm supposing yes, as we could issue to multiple recipients who immediately retire them, each to their own location.

@clevinson @blushi would you be able to check this with Ron?

ruhatch added a commit that referenced this issue Jul 6, 2021
This commit introduces retirement locations for ecocredits. The retirement location is the location of the beneficiary or buyer of the retired credits. It is a string of the form <country-code>[-<sub-national-code>[ <postal-code>]], with the first two fields conforming to the ISO 3166-2 standard and the postal-code being an alphanumeric string up to 64 characters. The location is emitted during retirement events and can therefore be tracked by an indexer.

Closes: #328
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: x/ecocredit Issues that update the x/ecocredit module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants