Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consider using bitcore + bitcore-channel #2

Open
maraoz opened this issue Jan 22, 2015 · 3 comments
Open

consider using bitcore + bitcore-channel #2

maraoz opened this issue Jan 22, 2015 · 3 comments

Comments

@maraoz
Copy link

maraoz commented Jan 22, 2015

We have a payment channels implementation in bitcore: https://github.com/bitpay/bitcore-channel

Bitcore also provides some built-in and well-tested functionality I see you are implementing. For example, creating multisig scripts:
https://github.com/bitcoin-torrent/bitcoin-torrent/blob/master/bitcointorrent.js#L160
our version:
https://github.com/bitpay/bitcore/blob/master/lib/script/script.js#L541

Let us know if you're interested and we'd be happy to help in anything possible :)

@bitcoin-torrent
Copy link
Owner

Hey Manuel,
I actually looked at both Bitcore and BitcoinJS a few days ago, and I didn't see the payment channels support before. It would be actually better to merge the 2 libraries, as they are doing very similar things. I saw the bitcore payment channel developer guide before when you announced Bitcore v0.9, but later it was taken down: http://bitcore.io/guide/channel.html

Also, as I already implemented most of the payment channel, but left out some parts, I'm interested in if you have a way to handle it: for pushing the transactions to the blockchain, I thought of using chain.com. I see that bitcore has insight API, but I don't want users to run their own bitcoind (it would be better to have a Javascript SPV wallet, but until then chain.com seems the best way to publish a transaction).

The harder part is accepting the payment. I don't know how the payment protocol works, but I want to create a transaction with greenaddress (which guarantees not to double spend, thereby allowing instant transactions...I don't know any other instant transaction provider, although the greenaddress API is not the simplest), and after the refund transaction is signed by the server, I want the user to sign the original transaction. Do you know an elegant way to implement this? Or are you planning to create an API for this as well?

@maraoz
Copy link
Author

maraoz commented Jan 22, 2015

Here's the updated bitcore-channel link: http://bitcore.io/guide/module/channel/index.html

Regarding publishing the tx to the network, you can use https://github.com/bitpay/bitcore-explorers, and you don't need to configure anything. It'll just work using bitpays' public insight server (https://insight.bitpay.com/), no need to setup Bitcoin Core or insight locally.

For accepting payments, you can also use bitcore-explorers, and check an address' unspent outputs.

Regarding instant payments, we still don't have any open-source solution there. We're working on http://impulse.is/, but it's still early in development.

Final comment: You might want to check the code in https://github.com/streamium/paystream, which uses bitcore-channel and does similar stuff to what you want.

@bitcoin-torrent
Copy link
Owner

Thanks, it sounds great! It's hard to see which library is the best until I use it.
Impulse.is looks like a nice solution, but it will take a lot of time to mature (I also love greenaddress because I have a trezor, and I guess it will be non-trivial to implement Trezor support as well for an impulse wallet.
Currently the Popcorn Time team is not interested in bitcoin support in their client, and as this is just a hobby project for me, I will stop working on bitcoin-torrent until somebody else wants to work on it as well. But still thanks for the help, I'll make sure I try to use bitcore payments channel library if some developers are interested in continuing this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants