Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Nicolas Dorier on May 24, 2014, 10:53:52 AM



Title: BIP70 : Test vectors ?
Post by: Nicolas Dorier on May 24, 2014, 10:53:52 AM
I'm going to implement BIP70 in NBitcoin, the big problem is that I see nowhere any tests vector to ensure I process correctly the payments messages.
The bitcoin core source does not have any tests about that, and I see no reference implementation in the BIP.

Does someone know where I can find such test vectors ?


Title: Re: BIP70 : Test vectors ?
Post by: telepatheic on May 24, 2014, 03:24:13 PM
I don't think there are any test vectors. I think the best you can do is compare against bitcoinj (https://github.com/bitcoinj/bitcoinj/tree/master/core/src/main/java/com/google/bitcoin/protocols/payments) and modify bitcoinj's tests (https://github.com/bitcoinj/bitcoinj/blob/master/core/src/test/java/com/google/bitcoin/protocols/payments/PaymentProtocolTest.java) to test your implementation.


Title: Re: BIP70 : Test vectors ?
Post by: Nicolas Dorier on May 24, 2014, 03:28:41 PM
This suck :(
I would prefer having less, or no explanation page for a BIP but some rudimentary test vectors, than a novel without one. :(


Title: Re: BIP70 : Test vectors ?
Post by: Gavin Andresen on May 25, 2014, 02:55:06 PM
This suck :(
I would prefer having less, or no explanation page for a BIP but some rudimentary test vectors, than a novel without one. :(

Feel free to create some; code here: https://github.com/gavinandresen/paymentrequest


Title: Re: BIP70 : Test vectors ?
Post by: Nicolas Dorier on May 25, 2014, 06:15:25 PM
This suck :(
I would prefer having less, or no explanation page for a BIP but some rudimentary test vectors, than a novel without one. :(

Feel free to create some; code here: https://github.com/gavinandresen/paymentrequest

Gavin, I will, thanks to point out your utils, I will use that to make some test messages.
Will update the BIP once I implemented a compliant port on NBitcoin.

Maybe you can include your tool as reference in the BIP, this would help implementers.


Title: Re: BIP70 : Test vectors ?
Post by: Mike Hearn on May 26, 2014, 06:13:50 PM
We should add a link to Gavin's tool in the new developer guide I think. And yes, test vectors are badly needed!


Title: Re: BIP70 : Test vectors ?
Post by: Nicolas Dorier on May 26, 2014, 10:10:16 PM
Sadly, between the protobuf package not existing anymore (I guess protobuf-compiler is the new name), and the make that does not work, I can't try out. (pushd, popd command not found)
Not sure it is a big problem, but it is definitively not for a linux illiterate like me, I'll run an eclipse and the BitcoinJ implementation instead.


Title: Re: BIP70 : Test vectors ?
Post by: Nicolas Dorier on May 27, 2014, 03:58:39 PM
holy cow Gavin host a running paymentrequest generator at https://bitcoincore.org/~gavin/createpaymentrequest.php (https://bitcoincore.org/~gavin/createpaymentrequest.php),
Lucky enough to came accross it thanks to https://bitcoinj.github.io/payment-protocol#user-interface-considerations (https://bitcoinj.github.io/payment-protocol#user-interface-considerations)
Would have saved me so much time if I knew :(