tjl-dev / npass

nPass - Nano based tokens for web access
https://npass.dev/npass
7 stars 3 forks source link

nPass - Nano based tokens for web access

Overview

nPass is a chrome extension that interacts with web sites to generate and provide paid access tokens on demand, both for the general case of logging in to a site (no user registration required), and for access to individual content (no need to watch commercials).

The goal of nPass is to demonstrate a viable alternative to ad-supported content:

nPass is built on the Nano cryptocurrency network, which enables fast and feeless transactions for near instant token generation.

Visit https://npass.dev/npass for a detailed overview and live demonstration.

Screenshot

This repository contains npass-lib, a set of ReactJS widgets a web site can use to interact with the nPass extension, and npass-demo-server, an example Vertx (Kotlin) web server used to handle http based resource requests with embedded nPass tokens. The demo website code is included as npass-lib/example.

Extension Setup Instructions

Wallet Screen

Home Screen

Settings Screen

Token Screen

Site Integration

The npass-lib component library makes it easy to wrap your media content or web page with support for nPass token request and validation.

For example, to wrap an image with nPass support:

  const npassProps = {
      onTokenVerified: this.onTokenVerified,
      onTokenFailed: this.onTokenFailed,
      contentDetails: this.state.contentDetails,
      paymentDetails: this.state.paymentDetails,
  };  
  <NpassTokenImage {...npassProps} />

See the example site under npass-lib\example\src\App.js for further examples of how to wrap your content.

The npass-lib components will automate token request from the extension, and inject the received nPass Token into GET requests for the embedded content.

To process token validation securely, the site should run a simple back end service to handle the http(s) GET requests using a Bearer token in the Authentication header. A sample web server with the nPass Auth handler is provided under the npass-demo module.

Feel free to raise an issue or contact directly for any questions on site integration.

Architecture

nPass Component Diagram