risk_propagation.player module¶
Configuration of a bank
- class risk_propagation.player.Player(name, accounts, transactions, pool, paillier, delta=0.5)[source]¶
Bases:
object
Player class performing steps in protocol
- COMPENSATION_FACTOR = 1000000000000¶
- __init__(name, accounts, transactions, pool, paillier, delta=0.5)[source]¶
Initializes a player instance
- Parameters:
name (
str
) – the name of the playeraccounts (
DataFrame
) – a dataframe of accounts containing an initial risk score per accounttransactions (
DataFrame
) – a dataframe of transactionspool (
Pool
) – the communication pool to usepaillier (
DistributedPaillier
) – an instance of DistributedPaillierdelta (
float
) – the delta to use
- async decrypt()[source]¶
Decryption of the risk scores per bank, compensating for the COMPENSATION_FACTOR
- Return type:
None
- encrypt_initial_risk_scores()[source]¶
Encrypt the initialised risk scores of this player’s accounts
- Return type:
None
- property other_banks: Tuple[Bank, ...]¶
The other banks in the protocol
- Returns:
the other banks in the protocol
- property risk_scores: Dict[str, FixedPoint]¶
The plaintext risk scores belonging to this player’s bank
- Returns:
plaintext dictionary of risk scores
- Raises:
AttributeError – raised when risk scores are not available