Pattern α : Bob and Alice have already done the initial DMTP setup.

DMTP server verifies the signature and prove that DMTP key pair haven't been manipulated.
Alice client retrieves
Alice’s encrypted DMTP_priKeyandBob’s DMTP_pubKeyfrom the DBAlice decrypts
Alice’s DMTP_priKeywith her wallet.Alice generates the
combined secretfromAlice’s DMTP_priKeyandBob’s DMTP_pubKey5.Alice encrypts messages with
combined key (Alice & Bob)Store the
encrypted messagein DB and IPFS. The data to be stored will look something like this.{ "messages":"ENCRYPTED_MESSAGE_WITH_COMBINE_KEY", "sender": "SENDER_WALLET_ADDRESS", "receiver": "RECEIVER_WALLET_ADDRESS", "timestamp": "TIMESTAMP" }The CID of message data is stored in
Messagetable in DB andCIDtable in DB 【Messages Table】 ⇒ CID 【CIDs Table】 ⇒ [CID, CID, CID, CID, CID, CID]Periodically, sync all data in
CIDtable to IPFS and get CID All CIDs are stored in this file{ "ROOM_ID_A": ["CID", "CID", "CID", "CID", "CID"], "ROOM_ID_B": ["CID", "CID", "CID", "CID", "CID"], "ROOM_ID_C": ["CID", "CID", "CID", "CID", "CID"], }This CID is stored in the blockchain (Polygon)
string[] cids; function storeCID(string memory _cid) public onlyOwner{ cids.push(_cid); }
Last updated