Giter VIP home page Giter VIP logo

perun-payment-channels's Introduction

Perun Payment Channels

Ethereum payment channels implementing the Perun protocols.

Contracts

The contracts directory contains the smart contracts, currently

  • LedgerChannels: Single-deployment ledger channels smart contract.
  • Migrations: Truffle migrations.

Setup

Truffle and typescript are assumed to be installed globally (yarn global add truffle typescript or use your distro packages, e.g., pacman -Sy typescript for Arch Linux). Other dependencies are installed with yarn. The truffle configuration is set to use the system's solc solidity compiler, so install that one too (Arch Linux: pacman -Sy solidity).

Development

is done with the truffle framework and typescript.

Compilation

Compilation consists of three steps. First, the contracts are compiled using solc, by running truffle compile or yarn build:contracts. Then, typescript typings are generated using typechain for type-safe development of tests and applications (yarn build:types). Finally, the test and applications, written in typescript, are transpiled to javascript (yarn build:js). All three build steps can also be invoked at once with yarn build.

Deployment

First start a local Ganache blockchain and then issue truffle migrate. This deploys truffle's Migration contract as well as one instance of our contracts.

Testing

All tests are written in typescript. The runnable javascript tests are generated as part of yarn build. After this step, tests are run by yarn test or directly truffle test.

Copyright (C) 2019 Sebastian Stammler, Marius van der Wijden / MIT license (see LICENSE file)

perun-payment-channels's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

perun-payment-channels's Issues

Make remaining funds accessible or require equality in balance updates

A channel update is currently assumed valid if the sum of the new balances is <= the current sum.
If the strict inequality holds, some funds will currently be trapped in the contract. We could

  • make them accessible. E.g. by making the contract Ownable and put remaining funds on each update in an owner's balance
  • require strict equality on balance updates

close without update/version 0

If two parties want to close a channel without applying any update, i.e., restoring the initial balance, they currently have to generate and sign a version 1 channel update with the initial balance. Does it make sense to add a closeNoUpdate() or closeInitialBalance() or similar function?

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.