Model Signature#
- rizemind.authentication.notary.model.model_signature.hash_parameters(parameters: Parameters) bytes[source]#
Hashes the Parameters dataclass using keccak256.
- Parameters:
parameters – The model parameters to hash.
- Returns:
The keccak256 hash of the concatenated tensors and tensor type.
- rizemind.authentication.notary.model.model_signature.recover_model_signer(*, model: Parameters, round: int, domain: EIP712DomainRequiredFields, signature: Signature) ChecksumAddress[source]#
Recover the address of the signed model.
- Parameters:
model – The model’s parameters.
round – The current round number of the federated learning.
domain – The EIP712 required fields.
signature – The signature of the trainer/aggregator that sent the parameters.
- Returns:
The hex address of the signer.
- rizemind.authentication.notary.model.model_signature.sign_parameters_model(*, parameters: Parameters, round: int, domain: EIP712DomainRequiredFields, account: BaseAccount) Signature[source]#
Signs a model’s parameters using the EIP-712 standard.
@TODO -> requires double checking with domain :param account: An Ethereum account object from which the message will be signed. :param parameters: The model parameters to sign. :param domain: The EIP712 required fields. :param round: The current round number of the federated learning.
- Returns:
The SignedMessage from eth_account