vocdoni / vocdoni-node

A set of libraries and tools for the Vocdoni decentralized backend infrastructure, the main ground of our universally verifiable, privacy-centric and scalable digital voting protocol
GNU Affero General Public License v3.0
86 stars 16 forks source link

Organization special accounts #1007

Open jpaulet opened 1 year ago

jpaulet commented 1 year ago

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 commented 1 year ago

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:


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.