All Projects → Kava-Labs → cosmos-paychan

Kava-Labs / cosmos-paychan

Licence: Apache-2.0 license
A Cosmos SDK module to add payment channels to any blockchain built using the SDK.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to cosmos-paychan

distributed-compliance-ledger
DCL is a public permissioned ledger framework for Zigbee compliance certification of device models. The ledger is based on Cosmos SDK and Tendermint.
Stars: ✭ 41 (+192.86%)
Mutual labels:  cosmos-sdk
desmos
Improving the well-being of users on social networks through the blockchain technology.
Stars: ✭ 82 (+485.71%)
Mutual labels:  cosmos-sdk
sommelier
Sommelier Chain
Stars: ✭ 64 (+357.14%)
Mutual labels:  cosmos-sdk
cosmospy
Python tools for Cosmos wallet management and offline transaction signing
Stars: ✭ 57 (+307.14%)
Mutual labels:  cosmos-sdk
interchain-security
interchain-security houses the code implementing interchain security (aka replicated security) for Cosmos based blockchains.
Stars: ✭ 96 (+585.71%)
Mutual labels:  cosmos-sdk
juno
Open Source Platform for Interoperable Smart Contracts
Stars: ✭ 267 (+1807.14%)
Mutual labels:  cosmos-sdk
SecretNetwork
𝕊 The Secret Network
Stars: ✭ 466 (+3228.57%)
Mutual labels:  cosmos-sdk
Cosmos Sdk
⛓️ A Framework for Building High Value Public Blockchains ✨
Stars: ✭ 3,144 (+22357.14%)
Mutual labels:  cosmos-sdk
lfb
LINE Financial Blockchain forked from gaia(https://github.com/cosmos/gaia)
Stars: ✭ 30 (+114.29%)
Mutual labels:  cosmos-sdk
keplr-wallet
The most powerful wallet for the Cosmos ecosystem and the Interchain
Stars: ✭ 321 (+2192.86%)
Mutual labels:  cosmos-sdk
cosmostation-ios
👽 Cosmostation iOS Wallet
Stars: ✭ 14 (+0%)
Mutual labels:  cosmos-sdk
cosmos-keys
Library for creating keys and signing messages on Cosmos 🔑
Stars: ✭ 24 (+71.43%)
Mutual labels:  cosmos-sdk
curium
Bluzelle Decentralized Database Service
Stars: ✭ 61 (+335.71%)
Mutual labels:  cosmos-sdk
cosmonauts-world
Projects in the Cosmos and Tendermint ecosystem 🌌
Stars: ✭ 14 (+0%)
Mutual labels:  cosmos-sdk
cosmocope
Find repositories, releases, and modules for projects in the Cosmos ecosystem.
Stars: ✭ 13 (-7.14%)
Mutual labels:  cosmos-sdk
bonds
A custom Cosmos SDK module for universal token bonding curve functions.
Stars: ✭ 32 (+128.57%)
Mutual labels:  cosmos-sdk
testnets
Stargaze testnets
Stars: ✭ 43 (+207.14%)
Mutual labels:  cosmos-sdk
regen-ledger
Blockchain for planetary regeneration
Stars: ✭ 154 (+1000%)
Mutual labels:  cosmos-sdk
ledger-cosmos-js
No description or website provided.
Stars: ✭ 23 (+64.29%)
Mutual labels:  cosmos-sdk
likecoin-tx-poll
Firestore based service of polling eth status and resending tx
Stars: ✭ 13 (-7.14%)
Mutual labels:  cosmos-sdk

PayChan - a Cosmos SDK module

Go Report Card API Reference License

A Cosmos SDK module to add payment channels to any blockchain built using the SDK.

Payment Channels are a technology to speed up payments on blockchains while retaining strong security guarantees. They work by moving payments 'off-chain' to sidestep the bottleneck of blockchain throughput.

The Cosmos SDK is a modular framework for developers to quickly and easily build custom blockchains in Go. Blockchains can be built from modules containing specific functionality, such as this one.

Note: This project is new and unstable. Get involved!

Usage

This module currently implements unidirectional channels. Channels can be opened by a sender and closed immediately by the receiver, or by the sender subject to a dispute period. There are no top-ups or partial withdrawals (yet).

1) Create a channel

gaiacli tx paychan create cosmos1zls5y0yd9wvh86ceh9tz93eehvesa6d7p8qge8 100atom --from <sender's account name>

2) Send off-chain payments

Send a payment for 10 atom.

gaiacli tx paychan pay <channel ID> 90atom 10atom --filename payment.json

Send the file payment.json to your receiver. They can run the following to verify it.

gaiacli tx paychan close --dry-run --payment payment.json

3) Close the channel

The receiver can close immediately at any time.

gaiacli tx paychan close --from <receiver's account name> --payment payment.json

The sender can submit a close request, closing the channel after a dispute period. During this period a receiver can still close immediately, overruling the sender's request.

gaiacli tx paychan close --from <sender's account name> --payment payment.json

Installation

The aim is for this module to be usable in any cosmos sdk based blockchain. However the module interface in the sdk is currently being refactored so using this module may require some tweaks. See go.mod for the sdk version this was built against.

This module can be included in an sdk app in the same way the standard modules are (staking, gov, etc). It uses the module interface pattern introduced in sdk v0.35.0.
It includes:

  • cli and rest interfaces
  • tx types and handler
  • endblocker to close payment channels

TODOs

Features

  • layer 2 utilities - receiver http server and channel watcher
  • configurable channel timeouts
  • use BFT time rather than block height for chanel timeouts
  • allow channel signing key to be different from account key
  • sender slashing on early close
  • channel top ups and partial withdrawals
  • bidirectional channels (with cooperative close)
  • multiparty channels

Testing

  • integration test
    • possible bug in submitting same update repeatedly
  • test cli and rest
    • verify doesn’t throw json parsing error on invalid json
    • can’t submit an update from an uninitialised account

Code improvements

  • add querier
  • pin to cosmos-sdk v0.36.0 once released
  • change channel id to unit64
  • split participants into sender and receiver
  • use iterator for channels for efficiency - rename queue
  • tidy up channel signatures - split off signatures from update as with txs/msgs, can auth sigs be used?
  • custom errors, codespace
  • tags
  • clarify naming - paychan vs channel, rename update
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].