peerplays.memo module

class peerplays.memo.Memo(from_account, to_account, peerplays_instance=None)

Bases: object

Deals with Memos that are attached to a transfer


A memo is encrypted with a shared secret derived from a private key of the sender and a public key of the receiver. Due to the underlying mathematics, the same shared secret can be derived by the private key of the receiver and the public key of the sender. The encrypted message is perturbed by a nonce that is part of the transmitted message.

from peerplays.memo import Memo
m = Memo("peerplayseu", "wallet.xeroc")
enc = (m.encrypt("foobar"))
>> {'nonce': '17329630356955254641', 'message': '8563e2bb2976e0217806d642901a2855'}
>> foobar

Decrypt a memo

Parameters:memo (str) – encrypted memo message
Returns:encrypted memo
Return type:str

Encrypt a memo

Parameters:memo (str) – clear text memo message
Returns:encrypted memo
Return type:str