Skip to content

Scetinn/access-protocol

 
 

Repository files navigation

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

BPF_OUT_DIR=target/deploy 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 amman:start
yarn jest

This will:

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 53.0%
  • TypeScript 35.4%
  • Python 9.0%
  • Go 2.1%
  • JavaScript 0.3%
  • Shell 0.1%
  • Dockerfile 0.1%