  Advances in mobile computing have paved the way for new types of distributed
applications that can be executed solely by mobile devices on device-to-device
(D2D) ecosystems (e.g., crowdsensing). Sophisticated applications, like
cryptocurrencies, need distributed ledgers to function. Distributed ledgers,
such as blockchains and directed acyclic graphs (DAGs), employ consensus
protocols to add data in the form of blocks. However, such protocols are
designed for resourceful devices that are interconnected via the Internet.
Moreover, existing distributed ledgers are not deployable to D2D ecosystems
since their storage needs are continuously increasing. In this work, we
introduce and analyse Mneme, a DAG-based distributed ledger that can be
maintained solely by mobile devices. Mneme utilizes two novel consensus
protocols: Proof-of-Context (PoC) and Proof-of-Equivalence (PoE). PoC employs
users' context to add data on Mneme. PoE is executed periodically to summarize
data and produce equivalent blocks that require less storage. We analyze
Mneme's security and justify the ability of PoC and PoE to guarantee the
characteristics of distributed ledgers: persistence and liveness. Furthermore,
we analyze potential attacks from malicious users and prove that the
probability of a successful attack is inversely proportional to the square of
the number of mobile users who maintain Mneme.
