You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decentralized, meritocratic peer-review protocol for high-throughput research validation. Leverages a "Trustless Hybrid" model combining Chainlink VRF V2.5 for unbiased reviewer selection, an off-chain AI Agent for orchestration, and a staked human reviewer pool for qualitative validation.
Getter-Less Design
The contract intentionally exposes almost no view functions. Instead, every state mutation emits granular events. These events are picked up off-chain by Alchemy Notify webhooks and projected into a Neon Postgres database with Optimistic Concurrency Control. All frontend queries are served from that projection -- not from on-chain reads. This eliminates non-essential view functions, minimizes on-chain compute costs, and keeps gas consumption low. See @packages/cqrs for the full event sync and query layer.
Core Architectural Pillars
Trustless Selection (Chainlink VRF V2.5): Reviewers are selected from the pool via cryptographically secure randomness. The protocol funds the VRF subscription directly from the publisher's submission fee.
Meritocratic Hierarchy & Anti-Collusion: During selection, the protocol automatically assigns seniority to the reviewer with the highest reputation score. The selection logic strictly prevents publishers from self-reviewing, ensuring a 100% independent evaluation set.
O(1) Dynamic Reviewer Pool: The protocol manages an active reviewer pool using a "swap-and-pop" indexed array. Eligibility is determined dynamically based on a member's financial solvency (availableStake >= I_REVIEWER_STAKE).
Agentic Lifecycle Management: An authorized AI Agent acts as the protocol's orchestrator, handling early plagiarism detection, recording review submissions, and finalizing the verdict based on synthesized human feedback.
Architecture
BioVerifyV3 inherits from Chainlink's VRFConsumerBaseV2Plus and uses OpenZeppelin's ReentrancyGuard. Access control is lean by design: a single immutable I_AI_AGENT_ADDRESS gates all settlement functions via the onlyAgent modifier.
Key Types
PublicationStatus (enum)
Value
Meaning
SUBMITTED
Submitted and staked, awaiting AI pre-validation
EARLY_SLASHED
Slashed by the submission agent before peer review
Submit a publication with IPFS CID. Requires msg.value >= I_PUBLISHER_STAKE + I_PUBLISHER_MIN_FEE. The stake is fixed; the submission fee is derived as msg.value - I_PUBLISHER_STAKE and stored as paidSubmissionFee (funds VRF). Emits SubmitPublication.
payReviewerStake()
Stake exactly I_REVIEWER_STAKE to join the reviewer pool. Registers the member if new.
claim(amount)
Withdraw amount from availableStake. Non-reentrant.
receive()
Accept ETH donations into rewardPool.
Agent-Only (onlyAgent modifier)
Function
Description
pickReviewers(pubId)
Triggers Chainlink VRF to randomly select peer reviewers. Requires sufficient reviewer pool and reward pool liquidity.
recordReview(pubId, reviewer)
Marks a reviewer as having submitted their review for a publication. Idempotent.
earlySlashPublication(pubId, verdictCid)
Slash publisher before peer review (plagiarism detected by submission agent).
Settle a publication as SLASHED. Slashes publisher and negligent reviewers.
transferSlashPoolToTreasury(amount)
Send funds from slashPool to treasury. Non-reentrant.
moveSlashPoolToRewardPool(amount)
Move funds from slashPool to rewardPool.
VRF Callback (internal)
Function
Description
fulfillRandomWords(requestId, randomWords)
Called by Chainlink VRF. Selects unique reviewers from the pool (excluding the publisher), picks the senior reviewer by highest reputation, locks reviewer stakes, and emits Agent_PickReviewers.
Publication Lifecycle
Submission: A publisher stakes ETH and pays a submission fee (covering VRF gas + AI compute) to upload a research CID.
Initial Validation: The AI Agent performs an automated plagiarism check. If the paper fails, it is Early Slashed immediately. The process terminates here to save protocol resources and VRF costs.
Selection: If valid, the AI Agent triggers pickReviewers(). Chainlink VRF selects N unique reviewers from the available pool, assigning one Senior Reviewer based on reputation.
Review Phase: Human reviewers analyze the publication. The AI Agent records their participation via recordReview().
Final Settlement: Based on the synthesized human feedback, the AI Agent triggers one of two terminal states:
Publish: The paper is validated. Publisher and honest reviewers are rewarded.
Slash: The paper is rejected. Publisher is slashed; honest reviewers are still rewarded for their diligence.
Sustainability: Throughout this cycle, the protocol manages a Reward Pool and a Slash Pool. The AI Agent can reallocate funds from slashes to rewards to ensure long-term protocol solvency.
Terminal Outcomes
Outcome
Trigger Phase
Publisher Impact
Reviewer Impact
Early Slashed
Pre-Review (Immediate)
Slashed: stake moved to slash pool; reputation penalty.
None: no reviewers selected; no rewards distributed.
Negligent: locked stake moves to slashPool, I_REVIEWER_REWARD returned to rewardPool, reputation -= I_REPUTATION_BOOST.
Pools
rewardPool: Funded by receive() / constructor. At VRF fulfillment, I_VRF_NUM_WORDS * I_REVIEWER_REWARD is pre-provisioned (debited). When a reviewer is found negligent, their unused I_REVIEWER_REWARD is returned to the pool.
slashPool: Receives slashed stakes. Can be transferred to treasury or moved back to rewardPool by the agent.
Self-Sustaining VRF: The protocol implements a hybrid VRF v2.5 strategy. While managed via a Subscription ID for lower gas overhead, the contract automatically tops up the subscription balance using paidSubmissionFee via fundSubscriptionWithNative. This ensures the protocol is economically autonomous.
Getter-Less Event Projection: All non-essential state getters were removed in favor of a comprehensive event-emission strategy. Every state mutation emits indexed events that are captured off-chain by Alchemy Notify, projected into a Neon Postgres database with Optimistic Concurrency Control (blockNumber + logIndex ordering), and served as the read model for all frontend queries. See @packages/cqrs.
Economic Security: Branch coverage tests ensure that locked stakes are accurately accounted for across all edge cases, including senior reviewer exits, slashing scenarios, and concurrent review capacity management.
Infrastructure & Deployment
The deployment pipeline supports cross-chain portability, currently targeting Base Sepolia (L2) and Ethereum Sepolia (L1).
Dynamic Configuration: The deploy script utilizes block.chainid to inject network-specific parameters (VRF Coordinators, Gas Lanes, Sub IDs) at runtime, keeping core source code immutable.
Unified Verification: Leverages Etherscan API V2 with a universal key, enabling automated source code verification on both Etherscan and Basescan via a single foundry.toml configuration.
Strict Decoupling: Environmental variables and network constants are fully isolated from business logic, allowing deployment to any EVM environment compatible with Chainlink VRF v2.5.