provenance-io / provenance

A distributed, proof of stake blockchain designed for the financial services industry.
https://provenance.io
Apache License 2.0
87 stars 37 forks source link

Flexible party types #2149

Open scirner22 opened 1 week ago

scirner22 commented 1 week ago

Summary

Allow more arbitrary party types.

Problem Definition

// PartyType are the different roles parties on a contract may use
enum PartyType {
  // PARTY_TYPE_UNSPECIFIED is an error condition
  PARTY_TYPE_UNSPECIFIED = 0;
  // PARTY_TYPE_ORIGINATOR is an asset originator
  PARTY_TYPE_ORIGINATOR = 1;
  // PARTY_TYPE_SERVICER provides debt servicing functions
  PARTY_TYPE_SERVICER = 2;
  // PARTY_TYPE_INVESTOR is a generic investor
  PARTY_TYPE_INVESTOR = 3;
  // PARTY_TYPE_CUSTODIAN is an entity that provides custodian services for assets
  PARTY_TYPE_CUSTODIAN = 4;
  // PARTY_TYPE_OWNER indicates this party is an owner of the item
  PARTY_TYPE_OWNER = 5;
  // PARTY_TYPE_AFFILIATE is a party with an affiliate agreement
  PARTY_TYPE_AFFILIATE = 6;
  // PARTY_TYPE_OMNIBUS is a special type of party that controls an omnibus bank account
  PARTY_TYPE_OMNIBUS = 7;
  // PARTY_TYPE_PROVENANCE is used to indicate this party represents the blockchain or a smart contract action
  PARTY_TYPE_PROVENANCE = 8;
  // PARTY_TYPE_CONTROLLER is an entity which controls a specific asset on chain (ie enote)
  PARTY_TYPE_CONTROLLER = 10;
  // PARTY_TYPE_VALIDATOR is an entity which validates given assets on chain
  PARTY_TYPE_VALIDATOR = 11;
}

The party type is currently an enum. This is inflexible because anything that would deviate from this list cannot be used without a protocol change and release. Also, this list is generic, but was likely made with Figure's origination and servicing flow in mind.

Proposal

Given there's benefits to using an enum and also possibly not wanting to migrate from an enum to string type, I'm proposing the addition of the following types. These types would allow the caller to illustrate arbitrary parties on sessions without having to fit into the concrete party types that are already defined. This would be up to the caller, but including a description of the usage of these party types would be great inside of the scope specification.

// PartyType are the different roles parties on a contract may use
enum PartyType {
  ...
  PARTY_TYPE_GENERIC_1 = 12;
  PARTY_TYPE_GENERIC_2 = 13;
  PARTY_TYPE_GENERIC_3 = 14;
  PARTY_TYPE_GENERIC_4 = 15;
  PARTY_TYPE_GENERIC_5 = 16;
  PARTY_TYPE_GENERIC_6 = 17;
}

For Admin Use

iramiller commented 1 week ago

It would be nice to get a batch of these to add ... perhaps some that make sense for Infineo and their insurance use case and include those with this update as well... having a large list of types isn't the worst thing in the word.