Ink Protocol Developers

Resources for developers to build upon the Ink Protocol platform.

Owners

Owner is a generic term used to represent any application or platform that Ink Protocol transactions take place on.

  • Marketplaces
    Marketplaces that use Ink Protocol would mostly be owners, because the marketplace would likely facilitate the creation of Ink Protocol transactions on behalf of its buyers and sellers, and enforce things like policies and mediators.
  • Payment Applications
    Standalone payment apps that allow buyers and sellers to transact via Ink Protocol may be owners as well.

At a technical level, an owner is simply the contract/address specified during the creation of the transaction:

function createTransaction(address _seller, uint256 _amount, bytes32 _metadata, address _policy, address _mediator, address _owner) external returns (uint256);

Why are Owners Important?

The primary purpose of an owner is to signal to the Ink Protocol ecosystem that the transaction took place on a specific platform and was therefore subject to its rules and policies. This could be an important factor when a reputation service decides which types of feedback are most valuable.

Imagine two feedbacks from two transactions with different owners:

  • Transaction A's owner is a very reputable marketplace where buyers and sellers are all verified. All transactions are mediated, and there are small but significant seller fees on all transactions. All items require shipping and tracking information.
  • Transaction B's owner is a wild west type of marketplace. Anyone can easily buy and sell anything, and there are few rules that need to be followed. The marketplace isn't responsible for tracking the delivery of any goods (shipping, etc).

It's easy to see why a reputation service may value feedback from transaction A's owner more highly than feedback from transaction B's owner:

Transaction A's Marketplace

Transaction B's Marketplace

Free Listings?

:thumbsup:
No, there is a cost to each transaction/feedback.

:thumbsdown:
Yes, someone could cheaply create many transactions and feedbacks.

Proof of Delivery?

:thumbsup:
Yes, there's proof that each exchange took place.

:thumbsdown:
No, it'd be easy to create transactions that didn't actually happen.

Spammy Accounts?

:thumbsup:
Not likely, each buyer and seller verify their phone number or address with the marketplace.

:thumbsdown:
Very possible, all it takes is an email to sign up.

Marketplaces that integrate with Ink Protocol should work toward becoming known as a very reputable marketplace. It becomes a valuable differentiating factor to not only integrate with Ink Protocol (and allow sellers to build decentralized reputation), but to also be a preferred/reputable owner, which in turn lets sellers know that the feedback they build here will be that much more valuable.

Owner Verification

Owners are identified by an Ethereum address, which should belong to a smart contract deployed by the marketplace or payment app.

To prevent someone from falsely attributing their transaction to an owner (which may have negative consequences), during the creation of the Ink Protocol transaction a function call is made to the owner contract to authorize the transaction:

require(InkOwner(_owner).authorizeTransaction(
  _transactionId,
  msg.sender
));

The owner should verify that it knows the msg.sender and therefore trusts the transactions it creates. Only transactions that the owner authorizes will be able to be created.

Implementing an Owner Contract

Owner contracts must implement the InkOwner Interface. It's a simple interface that requires one function to be defined:

interface InkOwner {
  function authorizeTransaction(uint256 _id, address _buyer) external returns (bool);
}

The _id is the Ink Protocol transaction id, which should mostly be used for record keeping, so that the owner knows which transactions are tied to it. The _buyer corresponds to the msg.sender during transaction creation. Generally, an owner should simply verify that the _buyer is a known user on its marketplace, thereby trusting the transaction.

The function should return true if it wishes to allow the transaction to be created and attributed to the owner. Returning false will throw an error for the entire Ethereum transaction and the Ink Protocol transaction will not be created.

Updated 2 years ago

Owners


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.