mark

Mark

Web Contract to Mark Anything

Documentation


GitHub license npm npm Github Stars

⚡️ Introduction

Mark is a web contract implementation of the marking concept. It allows you to mark anything!

Data Model

A Mark is a data structure used in conjunction with the marking concept.

It allows an agent (source) to mark another person, place or thing (destination), including marking links.

The data structure follows the linkedobjects specification, and should be compatible with JSON-LD

Web Credit

Here is a full example of a Web Credits Object

{
  "@id": "urn:cuid:a74xt3jbin",
  "@type": "Credit",
  "source": "https://melvincarvalho.com/#me"
  "amount": 100,
  "currency": "Mark",
  "destination": "http://webr3.org/nathan#me",
  "description": "for technical help",
  "context": "https://github.com/project-bitmark/bitmark",
  "timestamp": 1640111035
}

Web Ledger

A web ledger in this case can be derived from the credit object

Both the webledger and the web credits will appear as JSON in the webcredits directory, which is in the .gitignore so that it can be a separate entity

Web Contract

The Web Contract is a single file that operates on the webcredits data store and is described here

Signing

Currently signing is done out of band using the gitmark protocol, but explicit signing will be added, in future

✍️ API

mark.js <amount> [description]

The following switches are allowed

--id            # the id for the credit object
--source        # the source of the mark
--amount        # how much
--currency      # the currency
--destination   # what is being marked
--description   # a description of why
--context       # optional additional context
--timestamp     # unix style timestamp
--infile        # custom file to use for credits
--indir         # custom dir to use for credits
--allowNegative # allows the ledger to go negative

or from npm

import mark from 'webcontracts-mark'

var credit = {
  id: data.id,
  source: data.source,
  amount: data.amount,
  currency: data.currency,
  destination: data.destination,
  description: data.description,
  context: data.context,
  timestamp: data.timestamp
}

function mark(credit, indir, infile)

indir and infile are optional and will default to ../webcredits/webcredits.json

⚖️ License