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

Organization special accounts #1007

Open
jpaulet opened this issue Jun 22, 2023 · 1 comment
Open

Organization special accounts #1007

jpaulet opened this issue Jun 22, 2023 · 1 comment

Comments

@jpaulet
Copy link
Member

jpaulet commented Jun 22, 2023

Organization special accounts would create a new type of meta-account for organizations on the Vochain blockchain. These accounts would not have a private key associated with them, but other accounts would be able to manage them. This would allow organizations to participate in the Vochain ecosystem and enable the creation of simple decentralized autonomous organizations (DAOs) on the Vochain blockchain.

With this change we create a distinction between account and organization (currently both concepts are mixed), providing then a better experience and more clarity for the end user.

@p4u
Copy link
Member

p4u commented Jul 13, 2023

Data models

The Account data structure needs to be modified and a new one for Organization needs to be added.

message Account {
    uint64 balance = 1;
    uint32 nonce = 2;
}
// indexed by account address (ethereum compatible)
message Organization {
    string name = 1; // name for the organization, length > 6 chars
    bytes owner = 2; // address of the organization owner, can change
    string infoURI = 3; // ipfs URL with the organization metadata
    repeated bytes managers = 4; // list of management Accounts
    uint64 balance = 5; // number of tokens hold by the organization
    uint32 electionIndex = 6; // number of elections created
}
// indexed by organization ID (hash{initialOwnerAddress + name})

Transaction setOrganizationTx

message SetOrganizationTx {
    TxType txtype = 1;
    uint32 nonce = 2;
    optional bytes owner = 3;
    optional string name = 4; 
    optional string infoURI = 5; 
    repeated bytes managers = 6;
    optional uint64 amount = 7;
}

txType can be one of the following:

  • CREATE_ORGANIZATION: creates a new organization, name is required and cannot be changed anymore. The account creating the organization is set as owner.
  • SET_ORGANIZATION_INFO_URI: sets the infoURI field. Only owner can do it.
  • SET_ORGANIZATION_OWNER: changes the owner (must be different). The new owner account must exist.
  • ADD_ORGANIZATION_MANAGERS: add one or multiple managers
  • DEL_ORGANIZATION_MANAGERS: remove one or multiple managers
  • DEL_ORGANIZATION: removes the organization, only the owner can do it
  • FUND_ORGANIZATION: an existing account sends balance to the organization (anyone can do it)
  • WITHDRAW_ORGANIZATION: withdraws a number of tokens from an organization. Only the owner can do it.

When a new Election is created for the organization, if the manager specify it in the transaction, the price of the election is deducted from the organization's balance.

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

No branches or pull requests

2 participants