Coder Social home page Coder Social logo

fevm22's Introduction



Datamarket

Datamarket is an open blockchain platform designed to enable anyone to create data purchase or checkout pages managed on the FEVM network.

This project was built for HackFEVM 2022, targeting the best new use of FEVM to build building blocks such as digital exchanges.

Note this project is currently a demo prototype and would require additional work to be production ready on FEVM mainnet.

Motivation

Decentralized exchanges, also known as DEXs, are peer-to-peer marketplaces where cryptocurrency traders make transactions directly without handing over management of their funds to an intermediary or custodian.

Existing data exchange platforms exist, like https://www.narrative.io/pricing, however either require long term commitments or having transactions mediated through a third party with high fees and staff overhead. With a tight pairing to Filecoin and support for deal-making, FEVM has the ability to support such native exchanges without introducing other networks or external bridges to facilitate storage.

How it works

Users create data pages which are purchase pages for secured IPFS datasets.

DataMarket is self-governing. If a bad or inaccurate dataset is uploaded and sold, a purchaser or potential purchaser can flag the dataset as being fraudulent. The dataset page is locked after three flags.

To ensure that the data provides user satisfaction, the owner of the listing is only paid out from the contract after three non-flagged successful sales, and each sale after that. This is done automatically via logic tied to the purchaseData contract method which releases the funds on the contract after the third purchase.

Each dataset cannot be modified after it is posted, but the price can be updated by the owner and the listing can be marked as inactive. A new page should be created if a dataset needs to be changed - this protects the mutability and trust of data collections that have already been deployed.

Using FEVM smart contracts, DataMarket can:

  1. Enable an immutable, append-only, history of interactions against DataMarket smartcontracts.
  2. Store the data in a scalable/low-cost way for data owners, where no single source has to be the custodian of the data log.
  3. Perform low-cost, high-volume, and fast transactions on the FEVM network.
  4. Be self-governing by the user base and flag or shut down any fraudulent pages by logic included in the FEVM smart contract.

Technologies used

FEVM: Serves as the primary smart contract network for the DataMarket application. FEVM enables fast and low-cost smart contract transactions that make it to deploy and interact with contracts in the field without heavy additional costs or time delays. Deployed DataContracts also enforce that the datasets be valid by enabling public users to flag suspicious listings.

IPFS: Record keeping and storage. IPFS is used as the main backend for all uploaded datasets attached to DataContracts. The url of the asset is provided to the user post-purchase.

WalletConnect: Serves as the wallet connector for authorizing DataMarket contract deploys and enabling users to connect their wallets securely to the DataMarket application.

The following contract events are emitted and can be listened to externally.

PurchaseCompleted: When a user completes the purchase on a data set page. PageFlagged: When a user flags a page as not having legitimate data.

Useful links

Running the app

Define the following environment variables.

    REACT_APP_STORAGE_KEY=  // Your web3.storage key, used for IPFS storage of datasets.
    REACT_APP_ACTIVE_CHAIN_ID= // (Optional) Can be adjusted to FEVM mainnet in the future, for now this field should be unset or set to 31415 for wallaby testnet.
    REACT_APP_WC_ID= // cloud.walletconnect.com app id (defaults to a demo app id).

yarn; yarn start

Datamarket should now be running on port 3000.

Potential future work

  • Add a usage fee that takes a small percentage of each purchase. This could be easily added to the checkout flow - for now the purchases are completely free.
  • Permanent data removal support from the filecoin network (uploaded sets remain live post-flagging currently).
  • Add a searchable interface to discover datasets deployed via the DataMarket application.
  • Reporting on Purchase and Flag events emitted from data exchanges.
  • Add support for user logins in addition to metamask (or wallet-based) logins.
  • Migration from mocks to interfacing with production Filecoin storage deals.

Screenshots / User flow

Home page

Connecting wallet

Creating a new data listing

Deployed listing

IPFS listing of a hosted asset

Purchase page for a dataset

Contract structure

Contract history

Deployed contract

fevm22's People

Contributors

cbonoz avatar

Watchers

 avatar  avatar

Forkers

userevolution

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.