AIP 4: Basic Encrypted Messages Source

AuthorDmitriy Soloduhin
Discussions-Tohttps://github.com/Adamant-im/AIPs/issues/7
StatusDraft
TypeStandards
CategoryARC
Created2018-06-09

Structure of basic encrypted messages in ADAMANT.

Simple Summary

Describing current structure of basic encrypted ADAMANT messages, so that extensions or alternative clients can rely on it.

Abstract

To standartize message exchange between different ADAMANT clients we need to describe how messages are stored and encrypted/decrypted.

Specification

Secure Message exchange is the base of ADAMANT messaging system.

Messages are encrypted using curve25519xsalsa20poly1305 (NaCl box) algorithm. Box is created using sender’s private key and recipient’s public key. Recipient’s public key is retrieved from network.

Private and public keys of account are instances of Ed25519 signing keys, so they should be converted into Curve25519 Diffie-Hellman keys first.

Syntax

Here is transaction asset contents syntax:

chat: {
  message: HEXIFIED_ENCRYPTED_MESSAGE
  own_message: HEXIFIED_NONCE
  type: 1
}

Rationale

Currently used mechanisms should also be documented, to make process of extending and updating clearer.

Copyright and related rights waived via CC0.