ERCs icon indicating copy to clipboard operation
ERCs copied to clipboard

I cant post and ERC!

Open robertjmapes opened this issue 5 months ago • 4 comments

So I will do it here, someone hurry up and implement this:

---
eic: 2002
title: EIC-2002 Decentralised Mail
author: Robert Mapes <[email protected]>
discussions-to: https://github.com/ethereum/EIPs/issues/2002
status: Draft
type: Standards Track
category: ERC
created: 2025-08-12
---

## Simple Summary

A decentralized protocol standard for secure, interoperable messaging between Ethereum addresses.

## Abstract

This standard proposes a messaging interface enabling users and smart contracts to exchange encrypted, verifiable messages directly on-chain or off-chain. It aims to facilitate private, trustless communication without relying on centralized messaging servers.

## Motivation

Currently messaging solutions either rely on centralized services or lack standardization. A unified protocol for sending and receiving messages tied to Ethereum addresses, compatible across wallets and dApps, improves usability, security, and adoption of decentralized communication.

## Public Key for Encryption

Each participant may publish a public encryption key, for example, a PGP public key or any chosen asymmetric scheme. Senders can then encrypt message payloads before calling `sendMessage`. This ensures only the intended recipient, who holds the matching private key, can decrypt the contents. The storage and retrieval of these keys is outside the minimal interface of this specification, but implementers should provide a method to set and get a public key for interoperability.

## Vulnerabilty

The payoff to allow for a 24/7 mail service where user rather than sell there data or pay server upkeep fees is that all messages are public so that if an encryption key is present then this would jepredize all messages, a way one could offset this would be to cycle the key so that in an event off a key being leaked that only a portion of data will be exposed.

## Example Implementaiton

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Mail
{
    address public owner;
    bytes public key;

    bytes[] private inbox;

    constructor(bytes memory _key)
    {
        owner = msg.sender;
        key = _key;
    }

    function sendMessage(bytes calldata message) external
    {
        inbox.push(message);
    }

    // View a message by index
    function getMail(uint index) external view returns (bytes memory)
    {
        require(index < inbox.length, "No mail at index");
        return inbox[index];
    }

    // Get total number of messages
    function getInboxCount() external view returns (uint)
    {
        return inbox.length;
    }

    // Owner-only: clear entire inbox
    function clearInbox() external onlyOwner
    {
        delete inbox;
    }

    function updatesKey(bytes calldata _key) external onlyOwner
    {
        key = _key;
    }

    modifier onlyOwner()
    {
        require(msg.sender == owner, "Only owner");
        _;
    }
}

```

robertjmapes avatar Aug 12 '25 16:08 robertjmapes

When you say you can't post, do you mean you can't create a topic on Eth Magicians (you just need to create an account and read for a while), or do you mean you can't create a PR.

Please note, you don't get to pick your own ERC number. You will be assigned the next sequential number.

abcoathup avatar Aug 15 '25 08:08 abcoathup

When you say you can't post, do you mean you can't create a topic on Eth Magicians (you just need to create an account and read for a while), or do you mean you can't create a PR.

Please note, you don't get to pick your own ERC number. You will be assigned the next sequential number.

Thanks, what's your opinion on the content, a mailbox ERC standard?

robertjmapes avatar Aug 20 '25 23:08 robertjmapes

Thanks, what's your opinion on the content, a mailbox ERC standard?

I am not sure there is a need for message content onchain, rather than storing in decentralized storage.

I recommend checking existing ERCs, e.g. https://ethereum-magicians.org/t/erc-3722-poster-a-ridiculously-simple-general-purpose-social-media-smart-contract/6751

For an ERC it is worthwhile having multiple implementations from different teams. Have you implemented this?

abcoathup avatar Aug 22 '25 02:08 abcoathup

@robertjmapes If you intend to propose an ERC, I’d suggest first sharing the idea on Ethereum Magicians to collect initial feedback, and then documenting it following EIP-1.

poojaranjan avatar Oct 03 '25 17:10 poojaranjan