Permissionless-Software-Foundation / ipfs-p2wdb-service

Pay-to-write Database Service using REST API over HTTP and JSON RPC over IPFS
MIT License
3 stars 4 forks source link

ipfs-p2wdb-service

js-standard-style semantic-release

Overview

P2WDB is an acronym for pay-to-write database. It's a peer-to-peer (p2p) database that operates over IPFS, is anchored in a blockchain, and strikes a balance between blockchains and modern web-based databases. Visit P2WDB.com for documentation.

This code repository is the 'server' or 'service' side, for operating a P2WDB locally. If you simply want to read or write data to the P2WDB, check out the 'client' JavaScript library: p2wdb.

The P2WDB has the advantages of a blockchain:

The P2WDB has the advantages of a web-app database:

Read more documentation at P2WDB.com.

Interfaces

There are three primary communication interfaces for a P2WDB:

P2WDB Architecture

Each blockchain will have its own P2WDB instance that is specific to that blockchain. The local P2WDB can be written-to by providing a proof-of-burn on that blockchain. A proof-of-burn is simply a transaction ID (TXID), where a specific quantity of a specific token (e.g. $0.01 USD in PSF tokens) was burned in that transaction. That is the 'ticket' that lets a user write new data to the database. Anyone can read from the database for free.

The first P2WDB instance focuses on the BCH blockchain. In the future, when other blockchains are incorporated, the blockchain-specific P2WDBs will feed into a global P2WDB, which will be blockchain agnostic. This does not require any effort on the users part. Any data written to a blockchain-specific P2WDB will be automatically added to the global P2WDB. In this way, the P2WDB can function as a cross-blockchain communication medium and data provider.

Backups

Because the P2WDB is based on IPFS and OrbitDB, anyone at any time can backup the database onto Filecoin.

Keeping the P2WDB small and nimble ensures it's easy to replicate by many service providers. The more service providers participating in the ecosystem, the more censorship resistant the data becomes.

Requirements

Pedigree

ipfs-p2wdb-service is a fork of ipfs-service-provider. This project ports the pay-to-write (P2W) database (DB) specific code to the ipfs-service-provider boilerplate code. ipfs-service-provider provides both a REST API over HTTP interface (web2) and JSON RPC over IPFS interface (web3) to access the P2WDB services.

Documentation:

Setup Development Environment

TODO: This section needs more information added to it.

There is additional developer documentation in the dev-docs directory.

If you need guidance or help, or have questions, join this Telgram channel.

License

MIT