vxm5091 / access-protocol-newimproved

playground version

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ACCESS Protocol

Table of content

  1. Concepts
  2. Backends
    • Javascript
    • Rust
    • Go
    • Python
  3. Smart contract
    • Program
    • Javascript bindings

Concepts

ACCESS Protocol lays the foundation for digital content monetization using a web3 wallet. Users get access to content by staking ACCESS tokens (through their StakeAccount) into the content publisher's pool (StakePool). ACCESS tokens are distributed to stakers and content publishers through an inflation schedule defined in the CentralState.

The protocol also has the possibility to create and sell bonds (BondAccount). Bonds allow the protocol to sell locked tokens with linear vesting. The locked tokens can be staked and used to access content of a staked pool.

Publishers need to adapt their backend infrastructures to support authentication and authorization via a web3 wallet. This authentication process relies on signature verifications and a demo example is implemented in the backends folder in JS, Rust, Go and Python.

Backends

The backends folder contains an example implementation of a REST API using a Solana wallet for authentication and JWT authorization. The example is implemented in Javascript, Rust, Go and Python.

It is strongly recommended to use either the Javascript or Rust implementation as these two language have the best Solana tooling.

Smart contract

The smart contract folder contains two subfolders: js and program.

Program

The program folder contains the Solana smart contract code, documentation can be generated using Rust doc

cargo doc

Functional test can be ran using Solana program test

cargo test-bpf --features days-to-sec-10s no-mint-check no-bond-signer

JS

The js folder contains the Javascript bindings of the smart contract. This package is published on NPM

npm i @access-protocol/js
yarn add @access-protocol/js

End to end tests are implemented using jest, they can be run using

yarn jest

This will:

  • Spawn a local solana test validator
  • Deploy the program
  • Run all the instructions of the protocol
  • Verify the states of each account at each step

About

playground version

License:GNU General Public License v3.0


Languages

Language:Rust 53.1%Language:TypeScript 35.5%Language:Python 9.1%Language:Go 2.1%Language:JavaScript 0.1%Language:Dockerfile 0.1%Language:Shell 0.0%