Open Marketplace Documentation

This document described the Open Marketplace and it's application.

The Open Marketplace is a subset of Open Source Software, which brings a Framework for Online and Offline trading of products, servicses and data.

Today's marketplace solutions are mostly owned by companies with profit orientated goals. We have the goal to build a sustainable marketplace focused on privacy and human rights. We are building a open and free marketplace, which enables trading local and global without any kind of fees. The decentral architecture enbales trust and security. The software is based on trusted standarts and specifications. The code of all applications is open source and free available in our code repository.

Architecture

Specification

Applications

Architecture

Application

Communication

Authentication

Decentralized identifiers (DIDs) are a new type of identifier that enables verifiable, decentralized digital identity. A DID identifies any subject (e.g., a person, organization, thing, data model, abstract entity, etc.) that the controller of the DID decides that it identifies.

Payment Providers

Payment Providers are possible services to pay an order, for example Paypal or IOTA.

IOTA

PaymentRequest

- address: String
- amount: int
// for what they payment is
- comment: String  // -> another body?
- timestamp
- timeout: int

Storage

Everything user-related is stored in the user's browser. Products need to be stored on a device that is 24/7 connected to the internet.

An Encrypted Data Vault

We store a significant amount of sensitive data online, such as personally identifying information (PII), trade secrets and customer information.

Differences between Solid and IPFS

Solid

  • File and graph store
  • Spec requires no encyption
  • Extended file metadata is supported
  • Read/write protocol: REST (LDP)
  • Auth: WebID-OIDC
  • Data locality: Server
  • Replication: None
  • Access Control: [Web Access Control (WAC)] (https://github.com/solid/web-access-control-spec)

IPFS

  • Content-addressable distributed file store
  • Spec requires no encyption
  • Extended file metadata is not supported
  • Read/write protocol: cli/HTTP
  • Data locality: Public nodes
  • Replication: Peer to peer
  • Access Control: None

Specification

Shop

This specification describes a decentralized shop model.

The Shop is simply a signet file with all kinds of information about the shop, like name, product list, and the owner. This file can be hosted on a decentralized network. That means it doesn't need to be deployed to on a server. Hosting a file is much cheaper than running a whole program. The file gets read and interpreted by the user.

Users can discover new shops in marketplaces.

For some services like sending a Mail or accept Paypal or Stripe, the shop needs to interact with a backend, to handle the logic.

Object

{
    // Unique shop id
    id: String,
    // Owner of the shop as DID
    owner: String,
    // Name of the shop
    name: String
    // This url returns a list off all products as json
    product_list_url: String
    categories: Array
}

JSON Example

{
    "id": "950371f9-34a4-49dd-9d55-31160e2d1caf",
    "name": "A Sample Shop",
    "owner": "did:iota:shopowner",
    "product_list_url": "https://openmarketplace.org/shops/950371f9-34a4-49dd-9d55-31160e2d1caf",
    "categories": [
        "books",
        "magazines"
    ]
}

JSON Schema

{
    "$schema": "http://json-schema.org/draft-07/schema",
    "$id": "http://example.com/example.json",
    "type": "object",
    "title": "The root schema",
    "description": "The root schema comprises the entire JSON document.",
    "default": {},
    "examples": [
        {
            "id": "950371f9-34a4-49dd-9d55-31160e2d1caf",
            "name": "A Sample Shop",
            "owner": "did:iota:shopowner",
            "product_list_url": "https://openmarketplace.org/shops/950371f9-34a4-49dd-9d55-31160e2d1caf",
            "categories": [
                "books",
                "magazines"
            ]
        }
    ],
    "required": [
        "id",
        "name",
        "owner",
        "product_list_url",
        "categories"
    ],
    "properties": {
        "id": {
            "$id": "#/properties/id",
            "type": "string",
            "title": "The id schema",
            "description": "A Unique shop id",
            "default": "",
            "examples": [
                "950371f9-34a4-49dd-9d55-31160e2d1caf"
            ]
        },
        "name": {
            "$id": "#/properties/name",
            "type": "string",
            "title": "The name schema",
            "description": "Name of the shop",
            "default": "",
            "examples": [
                "A Sample Shop"
            ]
        },
        "owner": {
            "$id": "#/properties/owner",
            "type": "string",
            "title": "The owner schema",
            "description": "Owner of the shop as DID",
            "default": "",
            "examples": [
                "did:iota:shopowner"
            ]
        },
        "product_list_url": {
            "$id": "#/properties/product_list_url",
            "type": "string",
            "title": "The product_list_url schema",
            "description": "This url returns a list off all products as json.",
            "default": "",
            "examples": [
                "https://openmarketplace.org/shops/950371f9-34a4-49dd-9d55-31160e2d1caf"
            ]
        },
        "categories": {
            "$id": "#/properties/categories",
            "type": "array",
            "title": "The categories schema",
            "description": "List of categories, which describes the shop.",
            "default": [],
            "examples": [
                [
                    "books",
                    "magazines"
                ]
            ],
            "additionalItems": true,
            "items": {
                "$id": "#/properties/categories/items",
                "anyOf": [
                    {
                        "$id": "#/properties/categories/items/anyOf/0",
                        "type": "string",
                        "title": "The first anyOf schema",
                        "description": "An explanation about the purpose of this instance.",
                        "default": "",
                        "examples": [
                            "books",
                            "magazines"
                        ]
                    }
                ]
            }
        }
    },
    "additionalProperties": true
}

Product

JSON Example

{
  "version": "0.0.1",
  "type": "https//openmarketplace.org/spec/types/product",
  "product": {
    "information": {
      "id": 1,
      "name": "einfachIOTA Magazin - IOTA in der Industrie",
      "description": "Das zweite einfachIOTA Magazin mit dem Motto: IOTA in der Industrie.",
      "image": "/products/eimag_v2_de.png",
      "categories": [ "Magazine", "eiMag"],
      "price": {
          "amount": 9.00,
          "currency": "EUR"
      }
    }
  }
}

JSON Schema

{
    "$schema": "http://json-schema.org/draft-07/schema",
    "$id": "http://example.com/example.json",
    "type": "object",
    "title": "The root schema",
    "description": "The root schema comprises the entire JSON document.",
    "default": {},
    "examples": [
        {
            "version": "0.0.1",
            "type": "https//openmarketplace.org/spec/types/product",
            "product": {
                "information": {
                    "id": 1,
                    "name": "einfachIOTA Magazin - IOTA in der Industrie",
                    "description": "Das zweite einfachIOTA Magazin mit dem Motto: IOTA in der Industrie.",
                    "image": "/products/eimag_v2_de.png",
                    "categories": [
                        "Magazine",
                        "eiMag"
                    ],
                    "price": {
                        "amount": 9.0,
                        "currency": "EUR"
                    }
                }
            }
        }
    ],
    "required": [
        "version",
        "type",
        "product"
    ],
    "properties": {
        "version": {
            "$id": "#/properties/version",
            "type": "string",
            "title": "The version schema",
            "description": "An explanation about the purpose of this instance.",
            "default": "",
            "examples": [
                "0.0.1"
            ]
        },
        "type": {
            "$id": "#/properties/type",
            "type": "string",
            "title": "The type schema",
            "description": "An explanation about the purpose of this instance.",
            "default": "",
            "examples": [
                "https//openmarketplace.org/spec/types/product"
            ]
        },
        "product": {
            "$id": "#/properties/product",
            "type": "object",
            "title": "The product schema",
            "description": "An explanation about the purpose of this instance.",
            "default": {},
            "examples": [
                {
                    "information": {
                        "id": 1,
                        "name": "einfachIOTA Magazin - IOTA in der Industrie",
                        "description": "Das zweite einfachIOTA Magazin mit dem Motto: IOTA in der Industrie.",
                        "image": "/products/eimag_v2_de.png",
                        "categories": [
                            "Magazine",
                            "eiMag"
                        ],
                        "price": {
                            "amount": 9.0,
                            "currency": "EUR"
                        }
                    }
                }
            ],
            "required": [
                "information"
            ],
            "properties": {
                "information": {
                    "$id": "#/properties/product/properties/information",
                    "type": "object",
                    "title": "The information schema",
                    "description": "An explanation about the purpose of this instance.",
                    "default": {},
                    "examples": [
                        {
                            "id": 1,
                            "name": "einfachIOTA Magazin - IOTA in der Industrie",
                            "description": "Das zweite einfachIOTA Magazin mit dem Motto: IOTA in der Industrie.",
                            "image": "/products/eimag_v2_de.png",
                            "categories": [
                                "Magazine",
                                "eiMag"
                            ],
                            "price": {
                                "amount": 9.0,
                                "currency": "EUR"
                            }
                        }
                    ],
                    "required": [
                        "id",
                        "name",
                        "description",
                        "image",
                        "categories",
                        "price"
                    ],
                    "properties": {
                        "id": {
                            "$id": "#/properties/product/properties/information/properties/id",
                            "type": "integer",
                            "title": "The id schema",
                            "description": "An explanation about the purpose of this instance.",
                            "default": 0,
                            "examples": [
                                1
                            ]
                        },
                        "name": {
                            "$id": "#/properties/product/properties/information/properties/name",
                            "type": "string",
                            "title": "The name schema",
                            "description": "An explanation about the purpose of this instance.",
                            "default": "",
                            "examples": [
                                "einfachIOTA Magazin - IOTA in der Industrie"
                            ]
                        },
                        "description": {
                            "$id": "#/properties/product/properties/information/properties/description",
                            "type": "string",
                            "title": "The description schema",
                            "description": "An explanation about the purpose of this instance.",
                            "default": "",
                            "examples": [
                                "Das zweite einfachIOTA Magazin mit dem Motto: IOTA in der Industrie."
                            ]
                        },
                        "image": {
                            "$id": "#/properties/product/properties/information/properties/image",
                            "type": "string",
                            "title": "The image schema",
                            "description": "An explanation about the purpose of this instance.",
                            "default": "",
                            "examples": [
                                "/products/eimag_v2_de.png"
                            ]
                        },
                        "categories": {
                            "$id": "#/properties/product/properties/information/properties/categories",
                            "type": "array",
                            "title": "The categories schema",
                            "description": "An explanation about the purpose of this instance.",
                            "default": [],
                            "examples": [
                                [
                                    "Magazine",
                                    "eiMag"
                                ]
                            ],
                            "additionalItems": true,
                            "items": {
                                "$id": "#/properties/product/properties/information/properties/categories/items",
                                "anyOf": [
                                    {
                                        "$id": "#/properties/product/properties/information/properties/categories/items/anyOf/0",
                                        "type": "string",
                                        "title": "The first anyOf schema",
                                        "description": "An explanation about the purpose of this instance.",
                                        "default": "",
                                        "examples": [
                                            "Magazine",
                                            "eiMag"
                                        ]
                                    }
                                ]
                            }
                        },
                        "price": {
                            "$id": "#/properties/product/properties/information/properties/price",
                            "type": "object",
                            "title": "The price schema",
                            "description": "An explanation about the purpose of this instance.",
                            "default": {},
                            "examples": [
                                {
                                    "amount": 9.0,
                                    "currency": "EUR"
                                }
                            ],
                            "required": [
                                "amount",
                                "currency"
                            ],
                            "properties": {
                                "amount": {
                                    "$id": "#/properties/product/properties/information/properties/price/properties/amount",
                                    "type": "number",
                                    "title": "The amount schema",
                                    "description": "An explanation about the purpose of this instance.",
                                    "default": 0.0,
                                    "examples": [
                                        9.0
                                    ]
                                },
                                "currency": {
                                    "$id": "#/properties/product/properties/information/properties/price/properties/currency",
                                    "type": "string",
                                    "title": "The currency schema",
                                    "description": "An explanation about the purpose of this instance.",
                                    "default": "",
                                    "examples": [
                                        "EUR"
                                    ]
                                }
                            },
                            "additionalProperties": true
                        }
                    },
                    "additionalProperties": true
                }
            },
            "additionalProperties": true
        }
    },
    "additionalProperties": true
}

Order

    {
      // A Unique Identitfier of the shop as DID
      shopId: DataTypes.INTEGER,
      orderStatus: OrderStatuses,
      createdAt: DataTypes.DATE,
      offer: {
          // this can be a list of all kind of products or services.
      },
      payment: {
          // Currency symbol. For ex.: USD, EUR
          currency: String,
          total: Number,
          available_types: Array<PaymentTypes>
      }
    },

OrderStatuses

  • Created
  • Accepted
  • Declined
  • Finished

PaymentTypes

  • CreditCard
  • PayPal
  • Cash
  • CryptoCurrency

Order Flow

Alice sells something online. She creates a new Product in the ANNA applications and choose only IOTA as payment provider.

  1. just A product need to created

  2. This product is public reachable.

  3. Alice needs to distribute the product link.

  4. Bob clicked on the link and want to buy it.

  5. An offer will be created.

- 1. prepares an offer object
- 2. sign the offer object with bobs private key
- 3. encrypt the offer object with alice public key
- 4. Send the offer to alice
  1. Alice fetches new offers and accepts bobs offer

  2. Alice acceps the payment, through sending a payment request to bob.

Marketplace

Marketplace Object

{
    // Unique Marketplace id
    id: String,
    // Owner of the Marketplace as DID
    owner: String,
    // This url returns a list off all shops as json
    shop_list_url: String
    category: String
}

Applications

ANNA

ANNA is an implementation of a decentralized eCommerce Platform written in Rust and compiles to WebAssembly (WASM).

The application runs in a browser and can be installed to the home screen on desktops and mobile devices. This is possible through Progressive Web Apps (PWA) and the Rust web framework yew.

The applications have serveral parts

  • Marketplace
  • Shop
  • Shopping Cart
  • Profile
  • Wallet
  • Scanner
  • Chat