Skip to content

Commit

Permalink
Merge pull request #7 from Swader/v1
Browse files Browse the repository at this point in the history
Proposing v1.0.0
  • Loading branch information
Swader authored Feb 5, 2021
2 parents 6e7b77d + 4def7be commit dc63ef4
Show file tree
Hide file tree
Showing 16 changed files with 1,192 additions and 7 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## RMRK v1.0.0 - 05.02.2021.

> ⚠ Because 0.1 was so broken it would have required a very large custom processor for a very small
> number of published RMRKs, we decided to deprecate it fully, CONSUME all published NFTs, and
> re-issue them, re-sending to their owners (this was done in agreement with both the current owners
> and the original minter).
### RIPs

- [RIP #001](https://github.com/Swader/rmrk-spec/issues/2): the NFT entity's computed ID field has
been updated to include minting block number.
- [RIP #002](https://github.com/Swader/rmrk-spec/issues/3): Embedded data - ability to directly add
data to an NFT and a collection, avoiding reliance on third party metadata. Accompanying metadata
is still recommended.
- [RIP #005](https://github.com/Swader/rmrk-spec/issues/6): Changing recommendation to use
`batchAll` instead of `batch`
- [RIP #006](https://github.com/Swader/rmrk-spec/issues/10): Implemented EMOTE interaction
- [RIP #007](https://github.com/Swader/rmrk-spec/issues/13): Removed version from collection payload

### Fixes

- Fixed some dead links and typos.
- Standard versions have been added to MINT and MINTNFT where previously there were none. Tools
should consider these interactions as 0.1 where non-specified.
- NFT standard used "name" as "instance" and as missing "instance". This has been fixed and
additionally clarified.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ The standards currently cover the following basic interactions:
- CHANGEISSUER changes the owner of the collection, affecting who can issue NFTs
- SEND, BUY are transactional
- LIST is used to list an NFT as for-sale on-chain
- MIGRATE (starting with 1.0.0) allows a collection issuer to migrate a collection and its child
NFTs to a new standard

Inspect each standard folder to see the specifics about these interactions and how to integrate
them.
Expand All @@ -35,16 +37,18 @@ A released version is **never** worked on again - all changes must happen via [R
and will apply to the next version only. It is up to the implementing library / UI to see previous
versions as invalid or demand a migration from an old version to a new version of an NFT (this will
usually involve a [CONSUME](#interactions) of an earlier NFT and a [MINTNFT](#interactions) into a
newer version of the collection). To be kept up to date on version changes, please _Watch_ this repo
or [subscribe to Dot Leap](https://dotleap.substack.com).
newer version of the collection) or a [MIGRATE](#interactions) interaction. To be kept up to date on
version changes, please _Watch_ this repo or [subscribe to Dot Leap](https://dotleap.substack.com)
or [NFT Review](https://news.nft.review).

### Currently published standards:

- none
- [0.1](https://github.com/Swader/rmrk-spec/releases/tag/0.1)
- [1.0.0](https://github.com/Swader/rmrk-spec/releases/tag/1.0.0)

### Standards under development:

- [RMRK0.1](standards/rmrk0.1/README.md)
- n/a

## Contributing

Expand Down Expand Up @@ -97,8 +101,8 @@ To implement this, the CryptoKitties game devs would:
> programmatically from CryptoKitties game devs' end, but this introduces a reliance on their
> service for the continuation of the game.
> This is an active area of research which we hope to have ironed out by v1.0 of the standards -
> ideally with an action-triggered MINT addition to the standard.
> This is an active area of research which we hope to have ironed out soon - ideally with an
> action-triggered MINT addition to the standard.
## Other Information

Expand Down
362 changes: 362 additions & 0 deletions dumps/remarks-4892957-5437981-0x726d726b.json

Large diffs are not rendered by default.

32 changes: 31 additions & 1 deletion implementers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,44 @@ Because RMRK is append-only and no state is being changed, every new block has t
introduce non-obvious state changes into the global NFT space living on RMRK. As an example, an
[NFT](standards/rmrk0.1/entities/nft.md) can change ownership due to a
[SEND](standards/rmrk0.1/interactions/send.md) interaction, or due to a
[BUY](standards/rmrk0.1/interactions/send.md) interaction. It is an implementer's duty to reconcile
[BUY](standards/rmrk0.1/interactions/buy.md) interaction. It is an implementer's duty to reconcile
all these changes across historical blocks to get an accurate picture of the current state.

> Note: By implementing things in the wrong order or not following recommended implementation
> guidelines, an implementer can cause financial loss to NFT minters, buyers, and sellers. There is
> no way to distinguish invalid interaction submissions compatible with RMRK from those that are
> valid, except by reconciling the **whole RMRK history from genesis**.
## Remark Dumps

For convenience, dumps of all RMRK remarks on Kusama in are stored in this repository for ease of
use. Running the `fetch` function of [rmrk-tools](https://github.com/swader/rmrk-tools) with the
appropriate block numbers will produce the same dumps, should one wish to double-check these data
sets.

## Consolidators

Consolidators are tools that take as input a list of remarks from the chain (ideally from dumps -
see above), process them one by one, and come up with a consolidated state of the NFT ecosystem on
that chain. The reference implementation is the [rmrk-tools](https://github.com/swader/rmrk-tools)
consolidator.

## Edge Cases and Caveats

### Missing version

Spec 0.1 had a bug - the version number of the standard was not included in the MINT and MINTNFT
interactions. Where missing, this version should be implied to mean 0.1. Since 1.0.0 onwards every
interaction has a version number.

### Batching

- `batch` operations are illegal since version 1.0.0 and `batchAll` should be used. See
[RIP #005](https://github.com/Swader/rmrk-spec/issues/6).
- whenever a single NFT has multiple interactions in a single block, ALL of them MUST be ignored and
deemed invalid. This is to prevent various double spends and other tricks possible in the time
span of a single block's execution.

---

This guide is still under development...
8 changes: 8 additions & 0 deletions standards/rmrk0.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ The following **interactions** are possible:
- [LIST](interactions/list.md) (List an NFT for sale)
- [BUY](interactions/buy.md) (Buy an NFT)
- [CONSUME](interactions/consume.md) (Burn an NFT)

## Known Issues

- some NFTs published under this standard have been published without dedicated tools and are
malformed.
[Example](https://polkascan.io/kusama/transaction/0xb8396caf702b3197cd6286b8d7424b255dd79e1e4d49e4a05ee66cae8d4bb3f3).
- this spec version had a bug in that it did not specify a standard version in the MINT and MINTNFT
interactions. When the version is missing from the MINT, it should be assumed to mean 0.1.
16 changes: 16 additions & 0 deletions standards/rmrk1.0.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# RMRK 1.0.0 standard

The following **entities** are defined:

- [COLLECTION + Metadata](entities/collection.md)
- [NFT + Metadata](entities/nft.md)

The following **interactions** are possible:

- [MINT](interactions/mint.md) (Minting a collection)
- [CHANGEISSUER](interactions/changeissuer.md) (Changing the issuer of a collection)
- [MINTNFT](interactions/mintnft.md) (Minting an NFT inside a collection)
- [SEND](interactions/send.md) (Sending an NFT to a recipient)
- [LIST](interactions/list.md) (List an NFT for sale)
- [BUY](interactions/buy.md) (Buy an NFT)
- [CONSUME](interactions/consume.md) (Burn an NFT)
121 changes: 121 additions & 0 deletions standards/rmrk1.0.0/entities/collection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Collection

This standard defines how **Collections** of NFTs are minted. Collections cannot be sent and are
effectively immutable after being created, with the exception of the issuer value. The current
issuer of the collection can assign a new issuer using a CHANGEISSUER interaction.

## Collection Standard

A collection MUST adhere to the following standard.

```json
{
"name": {
"type": "string",
"description": "Name of the collection. Name must be limited to alphanumeric characters. Underscore is allowed as word separator. E.g. VALHELLO-ITEMS is NOT allowed. VALHELLO_ITEMS is allowed."
},
"max": {
"type": "number",
"description": "How many NFTs will ever belong to this collection. 0 for infinite."
},
"issuer": {
"type": "string",
"description": "Issuer's address, e.g. CpjsLDC1JFyrhm3ftC9Gs4QoyrkHKhZKtK7YqGTRFtTafgp. Can be address different from minter."
},
"symbol": {
"type": "string",
"description": "Ticker symbol by which to represent the token in wallets and UIs, e.g. ZOMB"
},
"id": {
"type": "string",
"description": "A collection is uniquely identified by the first four and last four bytes of the original issuer's pubkey and the symbol. This prevents anyone but the issuer from reusing the symbol, and prevents trading of fake NFTs with the same symbol. Example ID: 0aff6865bed3a66b-ZOMB."
},
"metadata?": {
"type": "string",
"description": "HTTP(s) or IPFS URI. If IPFS, MUST be in the format of ipfs://ipfs/HASH"
},
"data?": {
"type": "object",
"description": "See Data"
}
}
```

When either metadata or [data](#data) is present, the other is optional. Data takes precedence
always. Note that because metadata contains description, attributes, third party URLs, etc. it is
still recommended to include it alongside `data`.

### Data

The `data` object is composed of:

- protocol (strict, see Protocols below)
- data
- type (mime type)

#### Protocols

| Protocol | Mime default | Description |
| --------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `ipfs` | image/png | Points to a directly interpretable resource, be it audio, video, code, or something else |
| `http(s)` | image/html | Points to a directly interpretable resource, be it audio, video, code, or something else (not recommended for use) |
| `p5` | application/javascript | Processing.js code |
| `js` | application/javascript | Plain JS code |
| `html` | text/html | HTML code, no need for `<html>` and `<body>`, can support dependencies but it's up to the author to prevent the dependencies from disappearing |
| `svg` | image/svg+xml | SVG image data |
| `bin` | n/a | binary, directly interpretable |

## Metadata

A collection SHOULD have metadata to describe it and help visualization on various platforms.

```json
{
"description": {
"type": "string",
"description": "Description of the collection as a whole. Markdown is supported."
},
"attributes": {
"type": "array",
"description": "An Array of JSON objects, matching OpenSea's: https://docs.opensea.io/docs/metadata-standards#section-attributes"
},
"external_url": {
"type": "string",
"description": "HTTP or IPFS URL for finding out more about this project. If IPFS, MUST be in the format of ipfs://ipfs/HASH"
},
"image": {
"type": "string",
"description": "HTTP or IPFS URL to project's main image, in the vein of og:image. If IPFS, MUST be in the format of ipfs://ipfs/HASH"
},
"image_data": {
"type": "string?",
"description": "[OPTIONAL] Use only if you don't have the image field (they are mutually exclusive and image takes precedence). Raw base64 or SVG data for the image. If SVG, MUST start with <svg, if base64, MUST start with base64:"
}
}
```

## Examples

Collection:

```json
{
"name": "Dot Leap Early Promoters",
"max": 100,
"issuer": "CpjsLDC1JFyrhm3ftC9Gs4QoyrkHKhZKtK7YqGTRFtTafgp",
"symbol": "DLEP",
"id": "0aff6865bed3a66b-DLEP",
"metadata": "ipfs://ipfs/QmVgs8P4awhZpFXhkkgnCwBp4AdKRj3F9K58mCZ6fxvn3j"
}
```

Metadata:

```json
{
"description": "Everyone who promoted [Dot Leap](https://dotleap.substack.com) via the in-email Tweet link is eligible.",
"attributes": [],
"external_url": "https://rmrk.app/registry/0aff6865bed3a66b-DLEP",
"image": "ipfs://ipfs/QmYcWFQCY1bAZ7ffRggt367McMN5gyZjXtribj5hzzeCWQ"
}
```
Loading

0 comments on commit dc63ef4

Please sign in to comment.