Git Product home page Git Product logo

vss-server's Introduction

Versioned Storage Service

Introduction to VSS (Versioned Storage Service)

VSS, which stands for Versioned Storage Service, is an open-source project designed to offer a server-side cloud storage solution specifically tailored for non-custodial Lightning supporting mobile wallets. Its primary objective is to simplify the development process for Lightning wallets by providing a secure means to store and manage the essential state required for Lightning Network (LN) operations.

In a non-custodial Lightning wallet, it is crucial to securely store and manage various types of state data. This includes maintaining a list of open channels with other nodes in the network and updating the channel state for every payment made or received. Relying solely on user devices to store this information is not reliable, as data loss could lead to the loss of funds or even the entire wallet.

To address this challenge, the VSS project introduces a framework and a readily available service that can be hosted by anyone as a Versioned Storage Service. It offers two core functionalities:

  • Recovery: In the event of a user losing their phone or access to their app's data, VSS allows for the restoration of the wallet state. This ensures that users can regain access to their funds, even in cases of device or data loss.
  • Multi-device Access: VSS enables multiple devices with the same wallet app to securely access and share LN state. This seamless switching between devices ensures consistent access to funds for users.

Clients can also use VSS for general metadata storage as well such as payment history, user metadata etc.

Motivation

By providing a reusable component, VSS aims to lower the barriers for building high-quality LN wallets. Wallet developers have the flexibility to either host the VSS service in-house, enabling easy interaction with the component, or utilize reliable third-party VSS providers if available.

VSS is designed to work with various applications that implement different levels of key-level versioning and data-integrity mechanisms. It even allows for the disabling of versioning altogether for single-device wallet usage, making it simple to get started.

The project's design decisions prioritize features such as multi-device access, user privacy through client-side encryption(e.g. using key derived from bitcoin wallet), authorization mechanisms, data and version number verifiability, and modularity for seamless integration with different backend technologies.

Modularity

VSS can work out-of-box with minor configuration but is intended to be forked and customized based on the specific needs of wallet developers. This customization may include implementing custom authorization, encryption, or backend database integration with different cloud providers. As long as the API contract is implemented correctly, wallets can effortlessly switch between different instances of VSS.

VSS ships with a PostgreSQL implementation by default and can be hosted in your favorite infrastructure/cloud provider (AWS/GCP) and its backend storage can be switched with some other implementation for KeyValueStore if needed.

Project Execution

To explore the detailed API contract of VSS, you can refer to the VSS API contract and can track project progress here. VSS execution is split into two phases, phase-I prioritizes recovery and single-device use, whereas phase-II covers multi-device use. The first phase is expected to be released in Q2 2023. The second phase will be subject to monitoring for demand from wallets and may slip to 2024. [LDK-Roadmap]

Summary

In summary, VSS is an open-source project that offers a server-side cloud storage solution for non-custodial Lightning wallets. It provides multi-device access, recovery capabilities, and various features to ensure user privacy and data verifiability. By leveraging VSS, wallet developers can focus on building innovative Lightning wallets without the burden of implementing complex storage solutions from scratch.

vss-server's People

Contributors

g8xsu avatar moneyball avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vss-server's Issues

Add a health check API endpoint

To be able to deploy the VSS server in a highly available way, a health check endpoint just responding with a status code 200 would be handy.
Currently none of the API endpoints can be called to know if the server is up and running without really using the server already and store and retrieve data.

VSS Phase-II Tracking issue

Phase-II:
Overall: Phase-II covers multi-device parallel usage, where a 2+ devices use the same lightning state machine and vss as primary storage for critical data.
Ensuring sync b/w devices when one of them writes an update. Ensuring data-integrating by preventing lightning state from getting corrupted using key-level & global-level versioning.

VSS-Client Side :

  • PrimarySecondary KVStore Implementation
  • Sync client-side acc. to server side changes and ListKeysSummary
  • Client-side impl for atomic multi-value filesystem-based store (possible required in SQLite if sled doesn't work for us)
  • LDK-Node integration for error handling on write failure and re-sync local view storage and retry.
  • LDK Integration with additional error type on write. (has some unknowns)

VSS-Server Side :

  • Multi-tenanncy support - Create api to create storeId

VSS Tracking Issue

For background and an overview of the plan, see the LDK Roadmap.
This issue describes only execution plan specific to VSS.

Phase-I:
Overall: Phase-I covers single device usage, where a lightning node uses vss as primary storage for critical data(lightning state machine).

Tasks:
VSS-Server Side :

  • Model/Interface design for VSS Service (#1), #4)
  • Protobuf-generation setup for Server side ((#5))
  • DB Schema ((#5))
  • Service setup (REST) for VSS (#4)
  • JOOQ generation setup for VSS-DB ((#5))
  • Api Implementation for GetObject (#5)
  • Api Implementation for PutObject (#5)
  • Api Implementation for ListKeysVersions (#8)
  • Implement globalVersion/key-level concurrency checks for multi-device use in all of above API's (#5, #8)
  • Containerized Tests for Postgres implementation of Get, Put, ListKeyVersions and global/key-level versioning checks (#6)
  • REST Controllers/ Api handlers for all the above api's (Depends on all of above) ( #10) (#12)
  • Dependency Injection Setup (#11)
  • Connection management and pooling for server (#11)
  • Testing (Basic testing done with just rust client-side, to do more testing after ldk-node integration)
  • Create Delete Api and add delete in tx support in write api (#15, lightningdevkit/vss-rust-client#7)
  • Allow non-conditional put/delete operations (#17)
  • Usage Guide / Docs

VSS-Client Side

Protobuf struct/API docs

Annotate protobuf structs with more details.

The message docs can go into detail about the usage scenario.
And fields can explain anything that should be considered when setting them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.