## 5 The PoAP Consensus Mechanism
### The PoAP Consensus Process
#### 5.1.1 The Election Stage of PoAP  
The NexoNet is a public blockchain system, with user autonomy at the core of its design philosophy. All users are empowered to participate in the maintenance of the blockchain system: users can apply to become maintainers, or vote for maintainers they trust to elect committee members who execute the consensus mechanism. Voting for maintainers is conducted through voting transactions, with the voting weight determined by the number of PV held by each voter. This implies that the more actively a node participates in the system, the greater its influence during the consensus process, enabling it to exert a more significant impact, and garner more rewards from the incentive mechanism. To introduce randomness in the election process and prevent collusion attacks or the accumulation of power by maintainers, the PoAP consensus mechanism employs a cryptographic sortition algorithm. This randomness ensures that even maintainers who receive a highnumber of user votes cannot consistently dominate the block proposal process, as their election as proposers is randomized. This system guarantees that the control of the network remains decentralized and user-driven, preventing any single entity from accumulating excessive influence over the blockchain. The election stage proceeds as detailed below:  
User voting: Users cast their votes for their chosen maintainers using voting transactions by staking their \(PV\). In a voting round, users are required to stake all the \(PV\), with the staked amount being fully allocated to the target maintainer's voting pool, as shown in (5). \(Vote_{i}\) represents the voting pool of the maintainer. \(m\) is the number of voting users; if user \(u_{j}\) votes for the target maintainer \(m_{i}\), then \(Vote_{ij}=1\), otherwise \(Vote_{ij}=0\). \(PV_{j}\) represents the user's \(PV\).  
\[Vote_{i}=\sum_{j=1}^{m}PV_{j}\times Vote_{ij} \tag{5}\]  
Committee election: After user voting, each maintainer receives votes denoted by \(Vote_{i}\). To introduce randomness in the election process and prevent collusion attacks that could compromise system security, and to avoid fault from a single proposer during block proposing that could reduce consensus efficiency, PoAP employs a cryptographic sortition algorithm [47] during the committee election. Maintainers compute their hash values: \(\langle\text{hash},\pi\rangle\leftarrow\text{VRF}_{\text{sk}}(\text{seed})\) using a VRF random function and divide the [0,1] interval into continuous segments \(I^{j}\).  
\[I^{j}=\left[\sum_{k=0}^{j}B(k;Vote_{i},p),\sum_{k=0}^{j+1}B(k;Vote_{i},p) \right),\;\;j\in\{1,\ldots,Vote_{i}\} \tag{6}\]  
Here, \(p\) represents the probability of vote selection in consensus. If \(\text{hash}/2^{hashlen}\) falls within interval \(I^{j}\), then the maintainer's weight for this round of consensus is \(j\), and the sortition result can be verified by other maintainers. The weight \(j\) of each maintainer are sorted, and members whose \(j>0\) are selected as committee members, with the number of selected vote values determining their weight on the committee. If no vote value is selected, they remain as maintainers. The committee elected through this cryptographic sortition participates in the subsequent execution of consensus.