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

Auditable Storage Passing #1537

Open
johannbarbie opened this Issue Oct 29, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@johannbarbie

johannbarbie commented Oct 29, 2018


eip:
title: Auditable Storage Passing
author: Ben ben@ost.com, Johann <@JohBa>
discussions-to: https://ethereum-magicians.org/t/auditable-storage-passing/1722
status: Draft
type: Standards Track
category (*only required for Standard Track): ERC
created: 2018-10-29
requires (*optional): <EIP number(s)>
replaces (*optional): <EIP number(s)>

This is the suggested template for new EIPs.

Note that an EIP number will be assigned by an editor. When opening a pull request to submit your EIP, please use an abbreviated title in the filename, eip-draft_title_abbrev.md.

The title should be 44 characters or less.

Simple Summary

If you can't explain it simply, you don't understand it well enough." Provide a simplified and layman-accessible explanation of the EIP.

Abstract

We propose to extend non-fungible tokens (NFTs) with the ability to store data. This proposal wraps a store of data (eg. partricia tree) into the ERC721 interface. The ownership of the token can now grant access to the storage for writing and provides an audit trail for data updates across chains.

Motivation

The motivation is critical for EIPs that want to change the Ethereum protocol. It should clearly explain why the existing protocol specification is inadequate to address the problem that the EIP solves. EIP submissions without sufficient motivation may be rejected outright.

Specification

contract StorageToken is ERC721Token {
  mapping(uint256 => bytes32) public root;

  function readRoot(uint256 _tokenId) public view returns (bytes32) {
    return root[_tokenId];
  }

  function verifiedRead(
    uint256 _tokenId,     // the token holding the storage root
    bytes _key,           // key used to do lookup in storage trie
    bytes _value,         // value expected to be returned
    uint _branchMask,     // position of value in trie
    bytes32[] _siblings   // proof of inclusion
  ) public view returns (bool) {
    require(exists(_tokenId));
    return tree.verifyProof(root[_tokenId], _key, _value, _branchMask, _siblings);
  }

  function writeRoot(uint256 _tokenId, bytes32 _newRoot) public {
    require(msg.sender == ownerOf(_tokenId));
    root[_tokenId] = _newRoot;
  }
}

Rationale

The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion.-->

Backwards Compatibility

All EIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The EIP must explain how the author proposes to deal with these incompatibilities. EIP submissions without a sufficient backwards compatibility treatise may be rejected outright.

Test Cases

Test cases for an implementation are mandatory for EIPs that are affecting consensus changes. Other EIPs can choose to include links to test cases if applicable.

Implementation

The implementations must be completed before any EIP is given status "Final", but it need not be completed before the EIP is accepted. While there is merit to the approach of reaching consensus on the specification and rationale before writing code, the principle of "rough consensus and running code" is still useful when it comes to resolving many discussions of API details.

Copyright

Copyright and related rights waived via CC0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment