Bitcoin Forum
October 24, 2017, 11:52:47 AM *
News: Latest stable version of Bitcoin Core: 0.15.0.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Bitcoin nanopayments library in Node  (Read 1377 times)
hi-entropy
Newbie
*
Offline Offline

Activity: 7


View Profile
August 18, 2013, 03:46:48 AM
 #1

I'm working on a probabilistic nanopayments library in Node: https://github.com/hi-entropy/bitcoin-nanopayment

It's an implementation of jevon's idea from this thread: https://bitcointalk.org/index.php?topic=62558.0

It's still very much alpha-stage, but it should be usable if anyone wants to start developing applications that make use of nanopayments.  I would love any feedback on documentation clarity, bugs, feature requests, or anything else about it!  So, yeah... have at it!  Cheesy
1508845967
Hero Member
*
Offline Offline

Posts: 1508845967

View Profile Personal Message (Offline)

Ignore
1508845967
Reply with quote  #2

1508845967
Report to moderator
1508845967
Hero Member
*
Offline Offline

Posts: 1508845967

View Profile Personal Message (Offline)

Ignore
1508845967
Reply with quote  #2

1508845967
Report to moderator
1508845967
Hero Member
*
Offline Offline

Posts: 1508845967

View Profile Personal Message (Offline)

Ignore
1508845967
Reply with quote  #2

1508845967
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


View Profile
August 19, 2013, 12:23:37 PM
 #2

FYI,
https://github.com/gasteve/node-base58
https://github.com/gasteve/node-libcoin

Should be no need to create/duplicate base58 or bitcoin code, in node.js applications.


Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
TierNolan
Legendary
*
Offline Offline

Activity: 1120


View Profile
August 19, 2013, 04:40:45 PM
 #3

It's still very much alpha-stage, but it should be usable if anyone wants to start developing applications that make use of nanopayments.  I would love any feedback on documentation clarity, bugs, feature requests, or anything else about it!  So, yeah... have at it!  Cheesy

According to the thread, the same functionality can be achieved using the micro-payment channels system?

Apparently not, that refers to the OP's version.

So,

Bob creates a transaction that pays 0.01 BTC from himself to <public key> which has a hash of H.

Bob says to Alice "Create a transaction which pays 1 BTC to me and is paid from <tx-hash> output 0" and also signs it with "anyone can pay".   <tx-hash> can be any in the range from S to S + N, when S = H - rand(N).

With "anyone can pay", Alice can add extra inputs without invalidating Bob's signature, but she can't change the output (sending the money to Bob).

Alice sends the transaction to Bob.

If <tx-hash> matches, then Bob can submit both his transactions to the network.

The risk is that Alice will submit a transaction spending the input at the same time she sends the transaction to Bob.  However, she doesn't know which of the 1000 transactions is the valid one.

Cost to double spend: f (since you have to pay the BTC fee to add the transaction in the block-chain)
Benefit of double spend: V / N (since that is the expected loss of not double spending)

As long as f > V / N, then it isn't worth double spending.  The means that N has to increase as the value goes up.  Ironically, the transaction fee makes this service useful and also adds to its security.

That's pretty cool.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
hi-entropy
Newbie
*
Offline Offline

Activity: 7


View Profile
August 21, 2013, 04:39:28 AM
 #4

Hi Jeff, thanks for taking a look!  I will definitely switch to use those libraries; they look much better than the current solution that I have shitpatched together.
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526


View Profile
August 21, 2013, 05:29:02 PM
 #5

Very interesting work and neat protocol, congrats.
hi-entropy
Newbie
*
Offline Offline

Activity: 7


View Profile
August 22, 2013, 01:16:10 AM
 #6

Thanks Mike! Jevon and Casascius pretty much came up with the protocol, I just implemented it. I'll take credit for that though! Wink
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!