Skip to content

zTgx/paytube-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PayTube

A reference implementation of an off-chain state channel built using Anza's SVM API.

Overview

PayTube is an SVM-based payment channel that enables two or more parties to exchange SOL or SPL tokens off-chain. The channel is initialized by a "VM" (in this case, a Rust program) and, once transactions are complete, the final payment ledger is submitted to the Solana blockchain for settlement.

Key Features

  • Off-Chain Transactions: Facilitates rapid, low-cost transactions without the overhead of on-chain processing for each transfer.
  • SVM-Based: Leverages the Solana SVM for transaction processing within the channel.
  • Settlement to Solana: Ensures final balances are reflected on the Solana blockchain.
  • Native SOL and SPL Token Support: Supports transfers of both native SOL and SPL tokens.

Architecture

  1. Channel Initialization: A PayTubeChannel is created with a set of keys and an RpcClient.

  2. Transaction Processing: PayTubeTransaction objects are processed by the PayTubeChannel::process_paytube_transfers method. This involves:

  3. Settlement: The final ledger is generated by the PayTubeSettler, which creates and submits settlement transactions to the Solana blockchain.

Modules

Getting Started

Prerequisites

  • Rust toolchain
  • Solana CLI

Building

cargo build

SVM API

SVM API

About

SVM-based payment channel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages