Giter Site home page Giter Site logo

earthstar-project / meadowcap-js Goto Github PK

View Code? Open in Web Editor NEW
24.0 5.0 1.0 384 KB

A capability system for Willow.

Home Page: https://willowprotocol.org/specs/meadowcap/index.html#meadowcap

License: GNU Lesser General Public License v3.0

TypeScript 100.00%
capabilities willow p2p

meadowcap-js's Introduction

meadowcap-js

A TypeScript implementation of a capability system for use with the Willow protocol, according to the Meadowcap specification.

This implementation is currently being updated to conform to the latest Meadowcap specification.

In Willow, a namespace is a self-contained data space with three dimensions: time, path, and subspace. A namespace's individual entries correspond to points within this three dimensional space.

Meadowcap enforces boundaries on who gets to read and write what data in a Willow namespace. Read or write access can be bestowed, delegated to others, or further restricted within a given three dimensional area.

These boundaries are mediated by capabilities. A capability is an unforgeable token bestowing read or write access for some data to a particular person, issued by the owner of that data. These capabilities are cryptographically signed and verified using generic signature schemes (e.g. ed25519) provided by you.

Meadowcap distinguishes between two types of namespace:

  • Communal namespaces, where authority is derived from ownership of a given subspace key pair. This is a horizontal model where all members of a namespace have equal authority, and no-one has authority to all data in the namespace.
  • Owned namespace, where authority is derived from the ownership a given namespace keypair. This is a top-down model where the owner of the namespace keypair has total control over all data in the namespace, including data written by those who have had capabilities delegated to them.

Whether a namespace is communal or not is determined by a function provided by you. For example, making namespaces communal if their public key ends with a 0 bit.

Meadowcap will switch between using a (provided) subspace signature scheme or a namespace signature scheme depending on whether the namespace is communal or owned, respectively. Most of the time these schemes will be the same, but you can provide a trivial subspace scheme to effectively deactivate Willow's subspaces altogether, for example.

This system is meant to be used in tandem with Willow, and must be configured to use many of the same parameters (e.g. namespace signature scheme, payload digest encoder) as its parent Willow instance. These parameters can be provided via a MeadowcapParams object to construct a Meadowcap instance, which will then give you access to lots of useful methods and hopefully not have to think about those parameters anymore.

Usage

Complete API documentation can be found here.

With ESM imports:

import { Meadowcap } from "https://deno.land/x/meadowcap/mod.ts"

NPM distribution coming very soon.

Development

Deno is used as the development runtime.

Tests can be run with deno task test.


This project was funded through the NGI Assure Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement โ„– 957073.

meadowcap-js's People

Contributors

sgwilym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

kustomzone

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.