Académique Documents
Professionnel Documents
Culture Documents
The Oman Voting Network allows the voters to cast their vote for a candidate for a
particular election. The voter Participant and the candidate Participant must are approved
by Election Authority Participant to participate in the election. The candidate will request
for nomination through candidate Nomination Request transaction. The Election
Authority will approve the nomination request. Through election Authority Nomination
Approval Transaction or reject the nomination request through Election Authority
Nomination Reject Transaction. There are certain rules that must be applied for candidate
nomination approval. Once the candidate nomination is approved, the voter can cast their
vote for a particular candidate using the candidate Nomination ID with vote casting
transaction. Again, set of rules are applied before a voter can cast a vote. Once the vote is
casted, the candidate total votes are incremented by 1 vote. The figure 7.1 illustrates the
transaction for each participant.
Figure Error! No text of specified style in document..1: The transaction (Tx) for each participant
Oman Voting Network defines
Figure Error! No text of specified style in document..2: Oman Voting Network Participants
Hierarchal Details
Figure Error! No text of specified style in document..3: Oman Voting Network Asset Hierarchal
Details
Transactions: The figure 7.1 illustrates the transaction for each participant. The
transactions as following:
Prototype Files
Model file
Configure namespace
namespace om.oman.voting
Defined Participants
There are three participant in system include voter, candidate, and ElectionAuthority.
Figure 7.3 example of defining voter in module file.
Figure Error! No text of specified style in document..4: define voter participant in Model file
Defined asset
There are four asset in system include Election, Candidate Nomination, Nominating
Approval, and vote Casting. Figure 7.4 indicted defined candidate nomination asset
Figure Error! No text of specified style in document..5: Defined candidate nomination asset
The transaction consist candidate request citizen and nomination, voter request citizen
and voter cast vote, also election authority have to approved or rejected nomination.
The script file use JavaScript to define the actual e-voting system logic and functionality
of the voting application. For the voting application, the script file defines the voting
logic and rules. For instant, the election authority proves or rejects the nomination
candidate. Example of electionAuthorityNominationApprovalTrans Transactions
illustrate in figure.
Figure Error! No text of specified style in document..6: Transactions for election Authority to
approval Nomination
Prototype Test
Figure Error! No text of specified style in document..7: The web for voting-business-network
Administrator Add wallet to participants manual as illustrated in figure there are eight
wallets one for admin, three for candidate (C1, C2, and C3), three Voter (V1, V2, and
V3), and one election authority (E1) wallet. Each wallet have different account
Figure Error! No text of specified style in document..8: voting business network wallets
No transactions apply
For example if voter (v1) one want to cast vote for candidate (1) one thy have to approve
their citizen from election authority. Then candidate have to request nomination.
Candidate1 (C1) has citizen approval
Figure Error! No text of specified style in document..9: Candidate 1 has citizen approval
Figure Error! No text of specified style in document..10: Candidate 1(C1) Nomination request
Election authority Check the candidate1 caritera and create nomination approval.
Figure Error! No text of specified style in document..13: citizen approval of Voter 1 (V1)
Voter 1 cast vote for candidate 1
Figure
Error! No text of specified style in document..14: cast vote
Figure Error! No text of specified style in document..15: increase total of vote in the candidate 1
wallet
Conclusion
To test this Business Network Voting Network Definition in the Test tab: run the
setupDemo transaction using the admin user. This will create the following participants
and assets;
Create identities for all of the voter, candidate and electionAuthority participants. login
with candidateID1 and submit the candidateNominationRequestTrans transaction.
{
"$class": "om.oman.voting.candidateNominationRequestTrans",
"Election": "resource:om.oman.voting.Election#1",
"candidateNominationID": "1",
"candidateApplyDate": "2018-09-15T07:29:59.583Z",
"candidate": "resource:om.oman.voting.candidate#1"
}
The candidate ElectionAuthorityCitizenApproval will be set to Requested.
electionAuthorityNominationApprovalTrans
Now login with electionAughority1 and approve the nomination request by invoking
the electionAuthorityNominationApprovalTrans transaction.
{
"$class": "om.oman.voting.electionAuthorityNominationApprovalTrans",
"candidateNomination": "resource:om.oman.voting.candidateNomination#1",
"NominationApproveRejectDate": "2018-09-15T07:33:08.870Z"
}
This will approve the candidate nomination request. Now the voter can vote for that
candidate.
voteCastingTrans
Login as voter1 and invoke the voteCastingTrans transaction to cast the vote.
{
"$class": "om.oman.voting.voteCastingTrans",
"voter": "resource:om.oman.voting.voter#1",
"candidateNomination": "resource:om.oman.voting.candidateNomination#2",
"voteCastingID": "1",
"VoteCastingDate": "2018-09-15T07:36:35.981Z"
}
This will cast the vote and increment the candidate total votes by 1 vote.
The rest of the other transactions can be invoked for their particular use case.
Appendix F: User guide
namespace om.oman.voting
There are three participant in system include voter, candidate, and ElectionAuthority
o String voterID
o String fullName
o Integer age
o Nationality Nationality
enum ElectionAuthorityCitizenApproval {
o Requested
o Approved
o Rejected
enum Nationality{
o Omani
o NonOmani
o String candidateID
o String fullName
o Integer age
o Nationality Nationality
o Residance Residance
o Reputation Reputation
o Education Education
o String ElectionAuthorityID
o String fullName
There are three asset in system include Election, Candidate Nomination, Election, and
vote Casting.
o String ElectionID
o String YearOfElection
o electionStatus electionStatus
enum electionStatus {
o Enabled
o Disabled
o String candidateNominationID
-->candidate candidate
o DateTime candidateApplyDate
o NominationApproval NominationApproval
o Integer totalVotes
enum NominationApproval {
o Request
o Approved
o Reject
o String voteCastingID
-->voter voter
-->candidateNomination candidateNomination
o DateTime VoteCastingDate
The transaction consist candidate request citizen and nomination, voter request citizen an
and voter cast vote, also election authority have to approved or rejected nomination.
transaction candidateNominationRequestTrans {
o String candidateNominationID
o DateTime candidateApplyDate
-->candidate candidate
}
transaction electionAuthorityNominationApprovalTrans {
o DateTime NominationApproveRejectDate
transaction electionAuthorityNominationRejectTrans {
o DateTime NominationApproveRejectDate
transaction voteCastingTrans {
-->voter voter
-->candidateNomination candidateNomination
o String voteCastingID
o DateTime VoteCastingDate
transaction SetupDemo {
transaction voterCitizenRequestApprovalTrans {
o ElectionAuthorityCitizenApproval ElectionAuthorityCitizenApproval
transaction candidateCitizenRequestApprovalTrans {
o ElectionAuthorityCitizenApproval ElectionAuthorityCitizenApproval
}
1.3.2 The script file
The script file use JavaScript to define the actual e-voting system logic and functionality
of the voting application. For the voting application, the script file defines the voting
logic and rules. For instant, the election authority proves or rejects the nomination
candidate
if (tx.candidate.ElectionAuthorityCitizenApproval != 'Approved') {
if (tx.Election.electionStatus != 'Enabled') {
const NS = 'om.oman.voting';
candidateNomination.Election=tx.Election;
candidateNomination.candidate=tx.candidate;
candidateNomination.candidateApplyDate=tx.candidateApplyDate;
candidateNomination.NominationApproval='Request';
candidateNomination.totalVotes=0;
let a=0;
if (candidatesApplied.length > 0) {
for (let i = 0; i < candidatesApplied.length; i++) {
a=2;
if (a===0) {
await registry.add(candidateNomination);
else {
/**
* electionAuthorityNominationApprovalTrans Transactions
* @transaction
*/
if(tx.candidateNomination.candidate.Nationality != 'Omani'){
tx.candidateNomination.NominationApproval='Approved';
tx.candidateNomination.NominationApproveRejectDate=tx.NominationApproveRejectDate;
await assetRegistry.update(tx.candidateNomination);
/**
* electionAuthorityNominationRejectTrans Transactions
* @transaction
*/
tx.candidateNomination.NominationApproval='Reject';
tx.candidateNomination.NominationApproveRejectDate=tx.NominationApproveRejectDate;
await assetRegistry.update(tx.candidateNomination);
}
/**
* voteCasting Transaction
* @transaction
*/
if (tx.voter.ElectionAuthorityCitizenApproval != 'Approved') {
if (tx.candidateNomination.Election.electionStatus != 'Enabled') {
const NS = 'om.oman.voting';
voteCasting.voter=tx.voter;
voteCasting.candidateNomination=tx.candidateNomination;
voteCasting.VoteCastingDate=tx.VoteCastingDate;
let a=0;
//console.log(tx.candidateNomination.getIdentifier());
// if (!voteCasted.length <= 0) {
// throw new Error('there is no voting yest');
// }
if (voteCasted.length > 0) {
//continue;
a=2;
if (a===0) {
await registry.add(voteCasting);
tx.candidateNomination.totalVotes+=1;
await assetRegistry.update(tx.candidateNomination);
else {
/**
* electionAuthorityNominationRejectTrans Transactions
* @param {om.oman.voting.voterCitizenRequestApprovalTrans} voterCitizenRequestApprovalTrans
* @transaction
*/
tx.voter.ElectionAuthorityCitizenApproval=tx.ElectionAuthorityCitizenApproval;
await voterRegistry.update(tx.voter);
/**
* electionAuthorityNominationRejectTrans Transactions
* @transaction
*/
tx.candidate.ElectionAuthorityCitizenApproval=tx.ElectionAuthorityCitizenApproval;
await candidateRegistry.update(tx.candidate);