Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] address-to-address messaging contract #315

Closed
YoshihitoAso opened this issue Jul 7, 2021 · 0 comments
Closed

[FEATURE] address-to-address messaging contract #315

YoshihitoAso opened this issue Jul 7, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@YoshihitoAso
Copy link
Member

YoshihitoAso commented Jul 7, 2021

1. Is your feature request related to a problem? Please describe.

  • I want to add a contract that sends a simple text message from address to address.
  • The specification is supposed to be compliant with the EIP#802 specification, and I want to support text encryption.

Reference; ethereum/EIPs#802

2. Describe the solution you'd like

I propose the following specification.

Specification

Methods

Send message

function sendMessage(address _to, string memory _text)

Last Index

function lastIndex(address _owner) constant returns (uint256)
  • Returns an index of the last message for the _owner address.

Get last message

function getLastMessage(address _who) constant returns (address _from, string memory _text, uint256 _time)
  • Returns the last message for the _who address and the sender of this message.

Get message by index

function getMessageByIndex(address _who, uint256 _index) constant returns (address _from, string memory _text, uint256 _time)
  • Returns the message for _who address at _index position and the sender of this message.

Get public key

function getPublicKey(address _who) constant returns (string memory _key, string memory _key_type)
  • Returns a public key of the _who address and a type of this key.
  • _key_type is an encryption method that is agreed upon in advance between the sender and receiver of the message. For example, RSA2048 can be used as the setting value.

Set public key

function setPublicKey(string memory _key, string memory _key_type)
  • Sets a public key and a description of key type for the sender address.

Events

New message

event Message(address indexed sender, address indexed receiver, uint256 time, string text)
  • Triggered when a new message is sent.
  • This event logs timestamp of the message in UNIX seconds.

Public key updated

event PublicKeyUpdated(address indexed who, string key, string key_type)
  • Triggered when a customer updates a public key of an address or sets it first time.
  • This event logs a new public key and key type to make it easier to recognize which encryption algorithm should be used with this key.
@YoshihitoAso YoshihitoAso added the enhancement New feature or request label Jul 7, 2021
@YoshihitoAso YoshihitoAso self-assigned this Jul 7, 2021
YoshihitoAso added a commit that referenced this issue Jul 8, 2021
feat: add e2e messaging contract
@YoshihitoAso YoshihitoAso added this to the 21.9.0 milestone Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant