All Projects → bonedaddy → Postables-Payment-Channel

bonedaddy / Postables-Payment-Channel

Licence: Apache-2.0 license
Postables Reusable Multi Party Payment Channel. Efficient, and lean Payment Channels with a dash of airdrops. Written in Solidity with Golang bindings

Programming Languages

go
31211 projects - #10 most used programming language
solidity
1140 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Postables-Payment-Channel

useWeb3
useWeb3 provides a curated overview of the best and latest resources on Ethereum, blockchain and Web3 development.
Stars: ✭ 325 (+1150%)
Mutual labels:  smart-contracts
eosgo-client
A simple Go wrapper of EOS (eosio) RPC API, and more!
Stars: ✭ 29 (+11.54%)
Mutual labels:  smart-contracts
enigma-docker-network-deprecated
A containarized Enigma Protocol environment to start writing secret contracts
Stars: ✭ 50 (+92.31%)
Mutual labels:  smart-contracts
oasis-sdk
Official SDK for the Oasis Network.
Stars: ✭ 57 (+119.23%)
Mutual labels:  smart-contracts
Solidity
Smart Contracts - Solidity
Stars: ✭ 122 (+369.23%)
Mutual labels:  smart-contracts
MCW-Azure-Blockchain
MCW Azure Blockchain
Stars: ✭ 35 (+34.62%)
Mutual labels:  smart-contracts
luckydog
luckydog(锦鲤) 一个幸运小游戏
Stars: ✭ 14 (-46.15%)
Mutual labels:  smart-contracts
fair
Fairlayer node in JS
Stars: ✭ 80 (+207.69%)
Mutual labels:  payment-channel
prometheus-spec
Censorship-resistant trustless protocols for smart contract, generic & high-load computing & machine learning on top of Bitcoin
Stars: ✭ 24 (-7.69%)
Mutual labels:  smart-contracts
react-truffle-metamask
Build an DApp using react, redux, saga, truffle, metamask
Stars: ✭ 25 (-3.85%)
Mutual labels:  smart-contracts
colonySale
Colony Token and Crowdsale Contracts
Stars: ✭ 27 (+3.85%)
Mutual labels:  smart-contracts
flora
A distributed smart contract package manager to create a better and shared authority in the space.
Stars: ✭ 19 (-26.92%)
Mutual labels:  smart-contracts
gas-reporting
Reference documentation on every gas price API and all the different formats
Stars: ✭ 85 (+226.92%)
Mutual labels:  smart-contracts
t3rn
Composable smart contract hosting with fail-safe interoperable execution
Stars: ✭ 118 (+353.85%)
Mutual labels:  smart-contracts
docs
Unleash Bitcoin's full potential with decentralized apps and smart contracts. The documentation covers key aspects of the Stacks network and technology and provides tutorials and other helpful content for developers.
Stars: ✭ 134 (+415.38%)
Mutual labels:  smart-contracts
NYC-Blockchain-Devs
History of what we've completed and discussion on future topics in this meetup
Stars: ✭ 12 (-53.85%)
Mutual labels:  smart-contracts
hi-blockchain
Awesome blockchain resources
Stars: ✭ 14 (-46.15%)
Mutual labels:  smart-contracts
EVM-Simulator
EVM-Simulator bachelor's thesis.
Stars: ✭ 36 (+38.46%)
Mutual labels:  smart-contracts
market-oracle
Set of smart contracts on Ethereum deal with exchange rate reporting and aggregation
Stars: ✭ 49 (+88.46%)
Mutual labels:  smart-contracts
rICO-smart-contracts
Smart contracts for the Reversible ICO (rICO)
Stars: ✭ 38 (+46.15%)
Mutual labels:  smart-contracts

Postables-Payment-Channel

warning: none of this code is audited use at your own risk

Postables-Payment-Channel is a collection of easy to use smart contracts that can be used to facilitate arbitrary ERC20 and ETH payment channels between two parties, as well as an extremely cheap method of distributing airdrops using signed messages instead of mass transaction broadcasting called "AirDropChannels".

The payment channels are robust allowing for any ERC20 to be used, along with ETH itself. The channels support micro payments allowing a party to withdraw micro amounts from the channels available balance. This is useful in situations where the two parties may want the trust that comes with payment channels, but don't want to end the channel by withdrawing funds from it as is typical with the standard payment channel examples. This can be very useful if you are paying a contractor, and the contractor wants the assurance that all the funds they are being promised actually exist, but you don't want to pay them for work they haven't done yet.

AirDropChannels are a slightly modified payment channel concept, but instead of one-to-one unidirectional channels, it is a one-to-many unidirectional channel, allowing any number of parties to withdraw tokens from the channel! This can be used to facilitate stupidly cheap airdrops! Gone are the days of airdrops costing the token develop tens of thousands of dollars. One of the benefits to using this method of airdrops, is that unclaimed tokens are refunded back to the token developers wallet as soon as they close the channel! No more wasted money from tokens floating around in unused addresses for ethernity!

In addition golang, as well as very out of date python bindings exist to interact with the contracts using go-ethereum (go) and web3py (python).

Files

  • solidity/AirDropChannels.sol (modified payment channel allowing for cheap airdrops)
  • solidity/ChannelsV3.sol (base channel setup, no micropayment)
  • solidity/ChannelsV4.sol (base channel setup, micropayments)
  • solidity/ChannelsV5.sol (WIP)

Bugs and Fixes

Improper address returned from signature verification using python bindings

**note: this uses a very out of date version of web3py **

>>> private
b'\xd8Y\xe3T\xb8\x15\xaaJ\xe6i\xaf\xf9\x02\x8a\xbf\x89#\xf9D\x03\xdd\tc\xf2\xed\xc3\x9eQ\r\x98\xb7|'
>>> signature = w3.eth.account.sign(message_text="hello", private_key=private) 

AttributeDict({'message': HexBytes('0x68656c6c6f'), 'messageHash': HexBytes('0x50b2c43fd39106bafbba0da34fc430e1f91e3c96ea2acee2bc34119f92b37750'), 'r': 53665784189267139251820747046956462498355115993943239404465477346598658281299, 's': 6629064374810355767282561830725699037469490635953226814818888019755260187756, 'v': 27, 'signature': HexBytes('0x76a5c1e7f682df3375a2bdd6f72ad2171b0cf826fc8a8a3209c33a4e57e88f530ea7eadf8603ba2c4a5c5006571be7665020812aa7e403a614587cfe7a18146c1b')})
>>> h = Web3.toHex(signature.messageHash)
>>> v = signature.v
>>> r = Web3.toHex(signature.r)
>>> s = Web3.toHex(signature.s)
>>> h
'0x50b2c43fd39106bafbba0da34fc430e1f91e3c96ea2acee2bc34119f92b37750'
>>> v
27
>>> r
'0x76a5c1e7f682df3375a2bdd6f72ad2171b0cf826fc8a8a3209c33a4e57e88f53'
>>> s
'0xea7eadf8603ba2c4a5c5006571be7665020812aa7e403a614587cfe7a18146c'
>>> Web3.toHex(Web3.toBytes(signature.s))
'0x0ea7eadf8603ba2c4a5c5006571be7665020812aa7e403a614587cfe7a18146c' (returns the correct address)
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].