Here is a typical scenario repesented in this tutorial on selling:
You are a business/individual that has a valuable data asset - files, code, pipelines, documents. You wish to sell this data on an open marketplace while controlling the access rights to it. You would like to control the time for which this data is available, the storage location, the number of users that can access it and so on.

Here's how you can do this on Ocean Protocol:

  1. Defining a Data Asset
  2. Creating a Data Asset
    a. Creating a public URL on a cloud-based data-hosting service
  3. Creating a Datatoken
  4. Deploying Datatoken as a fixed-price asset
  5. Deploying Datatoken using liquidity pools
  6. Viewing Datatoken Details on Etherscan
  7. Exercises
  8. References

Defining a Data Asset

On Ocean Market, a Data Asset can be any one of the following:

  1. A directory or file containing structured / unstructured data in any format of choice.
    a. Tabular Data in csv/xslx format
    b. Unstructured data - text, video, html, pdf, ... formats
  2. An algorithm / piece of code
  3. A dynamic stream of data

The distinction is made because Ocean Market provides different publish workflows for each type of data. For instance, algorithms can be published using to Ocean Market's Compute-to-Data feature. That feature is fairly complicated for a 101-type guide. So, I'll leave the discussion on publishing an algorithm for a future time. In this article, let's focus on selling / publishing structured and unstructured data.

Creating a Data Asset

As a Data Asset Publisher, keep the end-consumer in mind. If you intend for this data to be used by a data scientist, use file formats commonly used by data scientists - e.g. CSV for structured data. If you intend to publish an e-book on Ocean Market tailored to a beginner audience, don't publish this in plain text format (Note-to-Self). In short, know the end-consumer for your data and tailor your data format to their needs.

Ocean Market needs a static i.e. permanent URL where your data resides. Your data will not reside on Ethereum. It is far too expensive and inefficient to do this at the moment. Other solutions (IPFS) and blockchains exist to solve this very problem (Arweave, Filecoin, Storj) and you might want to make use of these in the event that you do not have a hosting service.

During the Datatoken creation process, Ocean Protocol encrypts and writes the URL for your Data Asset on to Ethereum. Each time a consumer spends a Datatoken (i.e. uses it), Ocean Protocol de-crypts this URL and tries to access this asset and confirm its presence. If this asset is not present at the given URL, Ocean Market returns an error to the buyer. Unfortunately, by this time, the Datatoken has been spent. Angry buyers might contact you for refunds, or you might need to create a new Datatoken and spend more during the process. Ultimately, this is frustrating for you and the buyer.

So, if you intend for your Data Asset to be used, staked on and traded by as many users as possible, for as long as possible, you will need to ensure continuous availability of your Data Asset to buyers. The ideal way to do this is with a static URL where your data asset resides permanently.

Creating a public URL on a cloud-based data-hosting service

Popular cloud-based hosting services such as Google Drive, Microsoft OneDrive, DropBox provide the option to publish a file with a publicly accessible URL. Let's discuss this option in a little more detail.

I use Google Drive as an example of a prototypical cloud based service. If I have a CSV file that I'd like to make public, I simply open up the file using Google Sheets and navigate to File -> Share. You should get the following selection screen pop-up within the window.

Selling_URL_making_public-1

Select your desired format and select "Publish". A publicly shareable URL will be displayed in a text box. Copy and retain this URL for use later on in the Publishing process.

Creating a Datatoken

Navigate to the "Publish" page on Ocean Market - https://market.oceanprotocol.com/publish.

Prior to Datatoken creation, you will need to ensure the following:

  1. Your Metamask wallet is connected to Ocean Market.
  2. You have sufficient Rinkeby ETH (or real ETH in case your minting a Datatoken on the Ethereum mainnet) to pay for transaction fees.
  3. You have $OCEAN to pay for Datatoken creation using Ocean Protocol.
  4. You have a static URL that represents the location where the Data Asset can be downloaded from. You also have a static URL containing the data sample that you'd like to allow users to download before buying.
  5. You know the terms under which you're allowing this Data Asset to be accessed. For instance, access can be one time, or perpetual, or for a fixed duration.
  6. You know how much you'd like to charge for it OR you know that you'd like to create a DataToken-$OCEAN Liquidity Pool for it.

Selling_Publish_Page_Details

Having ensured the above, begin filling out the web form.

Pick a title and fill out a description that your end-audience will care to search for. For instance, if you are uploaded climate related data, make sure you create a title and description relevant to climate data. Using "test dataset" as a title won't help your end users or you as a seller.

The "Description" field supports Markdown. You can include links to your profile, markdown links to uploaded images in your markdown string and make it as descriptive as possible. You also want to hit the right keywords that you'd like to highlight for better discoverability.

Leave contact details in the description so that buyers can contact you in the event of an issue with their purchase.

In "File" and "Sample File", enter the URL created and saved using the procedure in the previous section. Ocean Market will try to ensure that the URL is valid and contains a file at location at the time of uploading. It will not allow you to publish a data asset without a valid URL.

Selling_Publish_page_URL

For "Access Type" select "Download". In this guide, your data asset is a downloadable file, not an algorithm.

For "Timeout", select the duration for which you want your Datatoken to be valid.

Ocean Market assigns tokens name when using the dApp, so you don't really have an option here other than refreshing the names and selecting a Marine Life Form + Adjective combination that appeals to you.

Selling_Publish_page_time

You will need to also accept the terms and conditions set in Ocean Market.

To aid discoverability, enter as many informative tags as possible.

Finally, click on "Publish" to begin the process of Publishing your data on Ocean Market. The dApp will open up your Metamask wallet and ask you to confirm your transaction. You should get a confirmation that looks like the screenshot below.

Selling_Publish_success_step_1

At this stage, your Datatoken has been created on Ocean Market, but hasn't yet been deployed on the Rinkeby testnet.

Deploying Data Token as a fixed-price asset

Click on the "Go to Data Set" option on the confirmation page. At this stage, Ocean Market allows you to price your Datatoken. Static/Fixed pricing ensures that you get a fixed amount of $OCEAN for every Datatoken sold there. Dynamic pricing deploys the token to $OCEAN-Datatoken pools. Select "CREATE PRICING" and then select "FIXED". Set the price that you think users might be willing to pay for access to your data. I don't want users to pay anything for my guide, in principle, but Ocean Market sets a floor price of 1 $OCEAN for fixed-price Data Assets, so that's what I'll use.

Selling_Fixed_Pricing

Clicking on "CREATE PRICING" begins a process called "Minting" the Datatoken. This will also require access to your wallet and you guessed it...transaction fees! Confirm your transaction on Metamask (this will take multiple steps).

Ocean Market will deploy the Datatoken as a fixed price smart contract on Rinkeby, and then give the ability to your account to spend these Datatokens. In other words, It will enable buyers to buy Datatokens from you in exchange for $OCEAN without you having to be the intermediary.

Selling_Deployment_success

At this stage your Datatoken is created, deployed / minted on the Rinkeby testnet as a fixed price asset. By default, Ocean Market mints 1000 Datatokens for a fixed-price asset. Reload the page and examine the contents of the Datatoken page. You might also want to add this token to your wallet by clicking on the Datatoken icon to the left of the bookmark icon.

Congratulations! Your Data DeFi journey stepped up to a whole new level. You now have the ability to create a basic Datatoken that can be priced and sold all over the world on an open, permissionless market!

Deploying Datatokens using Liquidity Pools

I'll go into greater depth on the topic of Liquidity Pools in the next chapter. But I want to first quickly outline why you might want to price your Datatoken using Liquidity pools.

When you set a fixed-price for a Data Asset, your assumption is that this is the "right" price for this asset. But how do you "know" this is the right price? One can never be sure of course. My guess is that your fixed-price is typically based on what you think people might be willing to pay for it OR the price that you think your Data Asset deserves. In other words, you determine what price your Data Asset deserves.

Liquidity pools allow market participants to determine the price of your asset dynamically. Participants are called Liquidity providers. They "pool-in" $OCEAN and your Datatoken in a smart contract. If your Datatoken is in demand, more people are willing to pool-in $OCEAN in the pool and the price of your Datatokens rises. Participants in the pool are rewarded with a cut of network fees in exchange for providing liquidity. If there isn't demand for your Datatoken or demand falls after rising, there will barely be any $OCEAN in the pool. And you might find out that the market is not willing to pay as much as you thought your asset deserves.

The procedure to deploy you Datatoken in a Liquidity Pool is almost identical to the procedure for deploying it as a Fixed-Price asset up to the point where you set its price.

While determining price, select the "DYNAMIC" option shown below

Selling_Pool_setting_details-1

As the initial liquidity provider, you get to set the initial price of the token in $OCEAN. I set the initial price of FABSTA-66 to 1$OCEAN/FABSTA-66. By default, Ocean Market sets the ratio of $OCEAN/Datatokens in a Liquidity Pool as 7/3. You will need to supply $OCEAN and Datatokens to this pool to set it up. Ocean Market also needs a defeault minimum of 9 Datatokens to set up the Liquidity Pool. So I've supplied the minimum of 21 $OCEAN needed to maintain the 7/3 ratio in the pool.

Besides these options, the Datatoken creator also has the option of increasing the staking fee beyond the default of 0.1% of network feesto incentivize liquidity provisioning. I've kept this option as the default for now.

Ocean Market will open up your wallet multiple times to confirm if you want to mint your Datatoken, create the liquidity pool and for permission to spend your $OCEAN and Datatoken to create the pool. Once you've accepted the terms and conditions and signed for the transaction, your Liquidity Pool will be deployed on Ocean Market.

Selling_Pool_token_details

As mentioned many times previously in this guide, you will need to be very sure about the options selected, since the creation of the pool and provisioning of initial liquidity is irreversible.

You will need to ensure that the amount of $OCEAN supplied initially is indeed something you can afford to lock-up in the pool. You will also need to ensure continuous data availability as before because users can still choose to buy the token from you outright in order to trade or use instead of staking.

Staking and Liquidity Provisioning is a relatively subtle topic that needs more explanation. I'll expand on this a little more in the chapter on Staking on Data Assets on Ocean Market.

Viewing Datatoken Details on Etherscan

Once you've deployed your Datatoken on Ocean Market, you can use Etherscan [1,2] to view the granular details of the underlying smart contract that represents the Datatoken and its deployment details on the Rinkeby testnet. Using Etherscan is also a useful way to get to know more details about Datatoken usage history (useful prior to investing in a token) and generally learn more about the Ethereum ecosystem.

In the case of the FABSTA-66 Datatoken created and deployed into a Liquidity Pool above, the token contract page is shown below with a number of relevant fields highlighted.

Selling_Rinkeby_token_page

It shows the maximum total supply of 9, which corresponds to the maximum number of FABSTA-66s minted during the pool creation process. As of this writing, there are 2 holders of this token. The first is the Liquidity Pool Contract Address (0xc4fa78e9a7f4b3e50dd1b2771e1727cfe413bef9) that holds the tokens in the LP on my behalf and the second is an address that swapped $OCEAN for FABSTA-66 (0x47e3190c58a5fc807bca1db7ac8582d8f1d5e6da).

As a result of this swap, the number of $OCEAN in the liquidity pool went up, while the number of FABSTA-66 went down. The price of each FABSTA-66 is now 1.302 $OCEAN. If pool participants swap $OCEAN out for FABSTA-66, this will reduce the amount of $OCEAN/FABSTA-66 in the pool and the price of FABSTA-66 (priced in $OCEAN) will decrease.

Decentralized Staking via Liquidity Pools is a relatively new development in the crypto world. Play around with the tokens on Rinkeby, the LP stats tab on Ocean Market and the Datatoken page to get familiar with the process and some of the terminologies surrounding Datatokens.

Better still, stick around with me as we move on to the next chapter of this guide, which is a more detailed discussion on this very topic - Staking.

Click here to go back to the table of contents.

Exercises

  1. Repeat the procedure outlined above with your own data asset. For starters, use a PDF or a text file. Ensure that you're on Rinkeby and that you have Rinkeby ETH as well as Rinkeby $OCEAN.
  2. By default, Ocean Market provides you with some options to configure access to your Datatoken. Click around the publication page to see if you can configure the number or Datatokens that can be issued. If you were able to do this through Ocean Market, please shoot me a tweet! If not, subscribe to my newsletter to find out how we can do this in code using Ocean.py.
  3. Add your token to your Metamask wallet and check the contents. Alternately, browse Etherscan to see the details. How many tokenholders are present at the time of issuance? How many tokens can you issue by default?

References

  1. Etherscan Ethereum Mainnet - etherscan.io
  2. Etherscan Rinkeby - rinkeby.etherscan.io