Skip to content

Saving and Displaying Image Onchain for Universal Tokens#2569

Merged
MicahZoltu merged 11 commits intoethereum:masterfrom
DAism2019:master
Jul 17, 2020
Merged

Saving and Displaying Image Onchain for Universal Tokens#2569
MicahZoltu merged 11 commits intoethereum:masterfrom
DAism2019:master

Conversation

@zhous
Copy link
Copy Markdown
Contributor

@zhous zhous commented Mar 27, 2020

A set of interfaces to save an SVG image in Ethereum, and to retrieve the image file from Ethereum for universal tokens.
It's an important ERC.

@zhous
Copy link
Copy Markdown
Contributor Author

zhous commented Mar 30, 2020

Welcome to the Ethereum Magicians forum to join the discussion:
https://ethereum-magicians.org/t/erc-2569-saving-and-displaying-image-onchain-for-universal-tokens/4167

@zhous
Copy link
Copy Markdown
Contributor Author

zhous commented Apr 5, 2020

Here shows "Some checks haven’t completed yet". Anybody could tell me how to complete the expected check?

@zhous zhous changed the title ERC for Saving and Displaying Image Onchain for Universal Tokens EIP for Saving and Displaying Image Onchain for Universal Tokens Apr 11, 2020
@zhous zhous changed the title EIP for Saving and Displaying Image Onchain for Universal Tokens Saving and Displaying Image Onchain for Universal Tokens Apr 11, 2020
zhous added 5 commits May 31, 2020 18:57
Fixed some wrong typing.
Fixed two wrong typing.
Fixed a wrong typing.
Fixed "type" from Standard Track to Standards Track.
@zhous
Copy link
Copy Markdown
Contributor Author

zhous commented Jun 10, 2020

Here's an application based EIP-2569: www.DHonor.io

@zhous
Copy link
Copy Markdown
Contributor Author

zhous commented Jun 10, 2020

Here's an application based EIP-2569: www.DHonor.io

@zhous
Copy link
Copy Markdown
Contributor Author

zhous commented Jul 17, 2020

I don't know why this EIP has not been accepted after several pulls. Please give us a help if you know the reason.

Here's an application based EIP-2569: www.DHonor.io
You can find the smart contract (early version) here:
https://github.com/naturaldao/DHonor

Comment on lines +21 to +23
A solution for storage of a fungible token's icon.
A solution for storage of a non-fungible token's icon.
A solution for storage of the icon/logo of a DAO's reputation token.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These will render as one paragraph. If you want a bulleted list you need:

Suggested change
A solution for storage of a fungible token's icon.
A solution for storage of a non-fungible token's icon.
A solution for storage of the icon/logo of a DAO's reputation token.
* A solution for storage of a fungible token's icon.
* A solution for storage of a non-fungible token's icon.
* A solution for storage of the icon/logo of a DAO's reputation token.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes made and committed

Hence we propose a set of interfaces to save an image for a universal token in Ethereum to keep the image permanent and tamper-resistant, and to retrieve an image for a universal token from Ethereum.

## Definitions
```tokenId```: for a non-fungible token such as an ERC-721 token or a multi-token such as an ERC-1155 token which has a member "ID" to specify its token type or token index our proposed interface assigns an SVG image's file content to a string variable of the token's contract and associates the SVG image to this "ID" number. This unique ID is used to access its SVG image in both a "set" operation and a "get" operation.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use single backticks around inline code:

`tokenId`: for a non-fungible...

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue in a number of places.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes made and committed

We propose to add three sol files in the existing ERC-721 implementation.
Here are the details for the proposed sol files.

```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solidity syntax highlighting will be added to the renderer soon, this will tell the renderer to render using Solidity syntax highlighting.

Suggested change
```
```solidity

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes made and committed

Comment on lines +51 to +53
Our proposed interfaces define how a smart contract saves an image for a universal token in Ethereum which keeps the image permanent and tamper-resistant, and how a smart contract retrieves an image from Ethereum for a universal token.

By calling our proposed interfaces we assume users are accessing an SVG image.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When authoring an ERC, write it as a specification rather than a suggestion of a specification. Instead of saying "Our proposed interfaces define..." say something like "An EIP-2569 compatible contract MUST have a method with the signature getTokenImageSvg(uint256) view returns (string memory)" or similar.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes made and committed

Comment on lines +63 to +64
Step 1: for a token such as an ERC-721 or ERC-1155 token which has a member variable "ID" to specify a token type or index and a member variable string to keep an (SVG) image associated with the "ID", retrieve the (SVG) image from Ethereum by calling our proposed "get" interface with the token's ID;
for a token which doesn't have a member variable "ID" to specify a token type of index but has a member variable string to keep an (SVG) image, retrieve the (SVG) image from Ethereum by calling our proposed "get" without an "ID".
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider defining the interface in the specification section as a Solidity interface, and include notes on any required behavior of the functions.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if I get your point. Would you please elaborate this a little bit? Did you mean I move the " setTokenImageSvg: for an ERC-721 .....getTokenImageSvg: for an ERC-721 ......" from the "Definitions" section to here , after "Step 2:......" and before "Step 1: for a token......" ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good specification may look something like this:

Implementations of this standard MUST implement the following interface:

interface Erc2569 {
    function getTokenImageSvg(uint256 id) returns (string memory);
    function setTokenImageSvg(string data) returns (uint256 id);
}

If you pass the id returned by setTokenImageSvg into getTokenImageSvg then getTokenImageSvg MUST return the same value that setTokenImageSvg was provided.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got your point after I reviewed EIP-1. Changes made and committed

Copy link
Copy Markdown

@MicahZoltu MicahZoltu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some initial feedback, and before being merged as final some changes should be made to this EIP. However, everything that is necessary for a draft merge is here so this is good to merge.

@MicahZoltu MicahZoltu merged commit 0259736 into ethereum:master Jul 17, 2020

Hence we propose a set of interfaces to save an image for a universal token in Ethereum to keep the image permanent and tamper-resistant, and to retrieve an image for a universal token from Ethereum.

## Definitions
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be not in line with the sections set out by EIP-1. Perhaps EIP-1 should be improved?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch. This should be a subsection of Specification rather than its own section.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got your point after I reviewed EIP-1. I made a relatively big change by merging the original "definition" section to the "specification" section. Changes made and committed.

@ethereum ethereum deleted a comment Jul 21, 2020
@ethereum ethereum deleted a comment Jul 21, 2020
tkstanczak pushed a commit to tkstanczak/EIPs that referenced this pull request Nov 7, 2020
A set of interfaces to save an SVG image in Ethereum, and to retrieve the image file from Ethereum for universal tokens.
It's an important ERC.
Arachnid pushed a commit to Arachnid/EIPs that referenced this pull request Mar 6, 2021
A set of interfaces to save an SVG image in Ethereum, and to retrieve the image file from Ethereum for universal tokens.
It's an important ERC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants