/** * @fileoverview Ban proposal validation with Sybil attack protections. * * Validates BAN_MEMBER proposals before submission and filters votes * to prevent coordinated abuse of the ban mechanism. * * Two key protections: * 1. Epoch restriction: members who joined in the current epoch cannot propose bans. * 2. Proposer-ally restriction: members admitted by the ban proposer cannot vote on * that proposer's ban proposals. * * @see Network Trust and Ban Mechanism spec, Requirements 1.6, 6.4, 6.5 */ import { PlatformID, TypedIdProviderWrapper } from '@digitaldefiance/ecies-lib'; import { BrightTrustEpoch } from '../interfaces/brightTrustEpoch'; import { Proposal } from '../interfaces/proposal'; import { IBrightTrustMember } from '../interfaces/services/brightTrustService'; import { Vote } from '../interfaces/vote'; /** * Provides the data needed by the validator to check admission history. * Implemented by the BrightTrust database. */ export interface IBanValidationDataProvider { /** Get a member by ID */ getMember(memberId: TID): Promise | null>; /** * Get the member ID of whoever proposed the admission of a given member. * Returns null if the member was a founding member (no proposer). */ getMemberAdmissionProposerId(memberId: TID): Promise; } /** * Validates BAN_MEMBER proposals and filters votes for Sybil protection. */ export declare class BanProposalValidator { private readonly dataProvider; private readonly idProvider; constructor(dataProvider: IBanValidationDataProvider, idProvider: TypedIdProviderWrapper); private idsEqual; /** * Validate a BAN_MEMBER proposal before submission. * * Checks: * 1. Proposer is not banning themselves * 2. Target member exists and is not already banned * 3. Proposer did not join in the current epoch (Sybil protection) * * @param proposerId - The member submitting the proposal * @param targetMemberId - The member to be banned * @param currentEpoch - The current BrightTrust epoch * @throws BrightTrustError if validation fails */ validateBanProposal(proposerId: TID, targetMemberId: TID, currentEpoch: BrightTrustEpoch): Promise; /** * Filter votes on a BAN_MEMBER proposal to exclude proposer-ally votes. * * A vote is excluded if the voter was admitted to the BrightTrust by the same * member who submitted the ban proposal. This prevents a single member * from admitting allies and immediately using their votes to ban others. * * @param proposal - The BAN_MEMBER proposal * @param votes - All votes cast on the proposal * @returns Filtered votes with proposer-ally votes removed */ filterVotes(proposal: Proposal, votes: Vote[]): Promise[]>; } //# sourceMappingURL=banProposalValidator.d.ts.map