mirror of
https://github.com/lux-apps/papers.git
synced 2026-10-30 18:15:21 +00:00
Every rendered "T-Chain" / "ThresholdVM" / "teleportvm" reference across the paper corpus is rewritten to the correct canonical chain by concern: threshold signing / MPC / bridge custody / key recovery -> M-Chain (MVM); FHE / encrypted compute / threshold decryption -> F-Chain (FVM); teleport / cross-chain messaging -> B-Chain (bridgevm); consensus Pulsar stays Q-Chain. Section lux-trust-kernel/03-t-chain-threshold-governance.tex renamed -> 03-f-chain-encrypted-policy.tex (with \input + xref fixes). Braided "T-Chain" sections split by concern (M vs F). Only lp-020's chain-separation rationale and the shared lux/chains/thresholdvm library path retain the name, to record the removal. All changed papers rebuilt (pdflatex, rc=0, no undefined refs). ยง09 of lux-dao-governance-framework reframed: fabricated "production deployment" metrics ($50M/$240k/$12M, survey %s, "as of Oct 2024") relabeled as illustrative design configurations with no invented replacements; reality noted (DAO treasury is a 1/1 Safe); conclusion echo + one "first production" overclaim softened. This commit also captures concurrent corpus workstreams on the same tree. Co-authored-by: Hanzo Dev <[email protected]>
159 lines
4.7 KiB
TeX
159 lines
4.7 KiB
TeX
\section{On-Chain Voting Implementation}
|
|
|
|
|
|
The on-chain substrate for Lux Governance is the Azorius modular framework: a
|
|
Safe treasury with a Zodiac-pattern Azorius execution module and pluggable
|
|
voting-strategy contracts, augmented with ERC-4337 gasless voting, Hats Protocol
|
|
roles, and ERC-6551 token-bound sub-accounts. That substrate is specified in the
|
|
companion \emph{Lux DAO: Modular Governance Framework} paper and is the canonical
|
|
governance implementation. The interfaces in this section describe the
|
|
Lux-specific coordination and voting-strategy logic layered on top of that
|
|
Azorius substrate --- proposal typing, validator-weighted votes, and
|
|
cross-ecosystem aggregation --- rather than a replacement for it. All execution
|
|
resolves through the Safe; all role gating resolves through Hats.
|
|
|
|
|
|
\subsection{Governance Smart Contract}
|
|
|
|
\begin{lstlisting}[language=Solidity,caption=Core governance contract interface]
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
pragma solidity ^0.8.20;
|
|
|
|
interface ILuxGovernance {
|
|
struct Proposal {
|
|
uint256 id;
|
|
address proposer;
|
|
string ipfsHash; // LP document on IPFS
|
|
ProposalType proposalType;
|
|
uint256 startBlock;
|
|
uint256 endBlock;
|
|
uint256 forVotes;
|
|
uint256 againstVotes;
|
|
uint256 abstainVotes;
|
|
bool executed;
|
|
mapping(address => Vote) votes;
|
|
}
|
|
|
|
enum ProposalType {
|
|
Standard, // Simple majority
|
|
Protocol, // Supermajority + validators
|
|
Economic, // Weighted voting
|
|
Emergency // Fast-track
|
|
}
|
|
|
|
enum Vote { None, For, Against, Abstain }
|
|
|
|
// Create new proposal
|
|
function propose(
|
|
string calldata ipfsHash,
|
|
ProposalType pType,
|
|
bytes calldata data
|
|
) external returns (uint256 proposalId);
|
|
|
|
// Cast vote with token weight
|
|
function castVote(
|
|
uint256 proposalId,
|
|
Vote vote
|
|
) external;
|
|
|
|
// Validators cast enhanced vote
|
|
function castValidatorVote(
|
|
uint256 proposalId,
|
|
Vote vote,
|
|
bytes calldata validatorProof
|
|
) external;
|
|
|
|
// Execute approved proposal
|
|
function execute(uint256 proposalId) external;
|
|
|
|
// Query proposal status
|
|
function getProposal(uint256 proposalId)
|
|
external view returns (Proposal memory);
|
|
}
|
|
\end{lstlisting}
|
|
|
|
\subsection{Voting Power Calculation}
|
|
|
|
\begin{lstlisting}[language=Solidity,caption=Voting power calculation with reputation]
|
|
contract VotingPower {
|
|
// Base voting power from staked tokens
|
|
function calculateBaseVotingPower(address voter)
|
|
public view returns (uint256)
|
|
{
|
|
return stakingContract.balanceOf(voter);
|
|
}
|
|
|
|
// Reputation multiplier (0-50% boost)
|
|
function calculateReputation(address voter)
|
|
public view returns (uint256)
|
|
{
|
|
uint256 participationCount =
|
|
governanceHistory.getParticipationCount(voter);
|
|
uint256 proposalQuality =
|
|
governanceHistory.getProposalQuality(voter);
|
|
|
|
// Reputation = 0.3 * participation + 0.2 * quality
|
|
// Max reputation: 0.5 (50% boost)
|
|
uint256 reputation =
|
|
(participationCount * 300 / 1000) +
|
|
(proposalQuality * 200 / 1000);
|
|
|
|
return min(reputation, 500); // Cap at 50%
|
|
}
|
|
|
|
// Final voting power
|
|
function getVotingPower(address voter)
|
|
public view returns (uint256)
|
|
{
|
|
uint256 base = calculateBaseVotingPower(voter);
|
|
uint256 reputation = calculateReputation(voter);
|
|
|
|
// VP = base * (1 + reputation)
|
|
return base * (1000 + reputation) / 1000;
|
|
}
|
|
}
|
|
\end{lstlisting}
|
|
|
|
\subsection{Quantum-Secure Vote Aggregation}
|
|
|
|
Votes are secured using dual-certificate signatures (BLS + Pulsar):
|
|
|
|
\begin{lstlisting}[language=Solidity,caption=Quantum-secure vote verification]
|
|
contract QuantumSecureVoting {
|
|
struct DualSignature {
|
|
bytes blsSignature; // 48 bytes
|
|
bytes pulsarSignature; // ~2.5KB
|
|
}
|
|
|
|
function verifyVote(
|
|
address voter,
|
|
uint256 proposalId,
|
|
Vote vote,
|
|
DualSignature calldata sig
|
|
) public view returns (bool) {
|
|
bytes32 message = keccak256(abi.encodePacked(
|
|
voter, proposalId, vote
|
|
));
|
|
|
|
// Verify both signatures (classical + quantum-safe)
|
|
bool blsValid = verifyBLS(
|
|
voter, message, sig.blsSignature
|
|
);
|
|
bool pulsarValid = verifyPulsar(
|
|
voter, message, sig.pulsarSignature
|
|
);
|
|
|
|
return blsValid && pulsarValid;
|
|
}
|
|
|
|
// BLS signature aggregation for efficiency
|
|
function aggregateVotes(
|
|
DualSignature[] calldata signatures
|
|
) public pure returns (bytes memory aggregatedBLS) {
|
|
// BLS signatures can be aggregated O(1)
|
|
return bls.aggregate(extractBLS(signatures));
|
|
}
|
|
}
|
|
\end{lstlisting}
|
|
|