Pages:
Author

Topic: NBitcoin : Stealth Address, DarkWallet compliant - page 3. (Read 3494 times)

hero member
Activity: 714
Merit: 662
piotr_n,
I am going to send 13 transactions to waPYjXyrTrvXjZHmMGdqs9YTegpRDpx97H5G3xqLehkgyrrZKsxGCmnwKexpZjXTCskUWwYywdUvrZK 7L2vejeVZSYHVns61gm8VfU
Do you confirm you have the spend priv key and scan priv key ?
(Scan = cc411aab02edcd3bccf484a9ba5280d4a774e6f81eac8ebec9cb1c2e8f73020a)
legendary
Activity: 2053
Merit: 1356
aka tonikt
Unfortunately, Electrum does not have testnet functionality, so I had to sacrifice 40 cents while experimenting.
That should motivate you to add testnet support there, at some point Wink
That would involve messing with the servers... and I'm not near good enough to add testnet support to the Electrum server repo...

heck, I'm not even good enough to do anything... but I do the best I can. :-)

oh, don't be so modest.

you are certainly good enough to be a pioneer of implementing the stealth payments Smiley
sr. member
Activity: 475
Merit: 252
Unfortunately, Electrum does not have testnet functionality, so I had to sacrifice 40 cents while experimenting.
That should motivate you to add testnet support there, at some point Wink
That would involve messing with the servers... and I'm not near good enough to add testnet support to the Electrum server repo...

heck, I'm not even good enough to do anything... but I do the best I can. :-)
legendary
Activity: 2053
Merit: 1356
aka tonikt
Unfortunately, Electrum does not have testnet functionality, so I had to sacrifice 40 cents while experimenting.
That should motivate you to add testnet support there, at some point Wink
sr. member
Activity: 475
Merit: 252
No I don't think there is anything wrong in my implementation.
Besides non-zero length prefixes, I have tested it quite much.

I can exchange coins via stealth addresses between DarkWallet and my s/w, including several sends in a single tx, and they never got missed.
So I guess it means that my implementation works?

I think it is more likely that Nicolas did something wrong during the first send.
We can try few more times though, if he wants, just to be sure.
I'm always open for more testing.


BTW, @dabura667, are you working on supporting non-zero length prefixes?
I'd like to test it against a different wallet as well.

I've only got sending working for Electrum. But yes, I have non-zero prefixes working for sending bitcoins.

Unfortunately, Electrum does not have testnet functionality, so I had to sacrifice 40 cents while experimenting.

Edit: Here's how I got it done in Python.

Code:
def check_prefix(pre_num, prefix, p_hash): # Check the first 'pre_num' bits of both 'prefix' and 'p_hash' and see if they match
    assert len(prefix) * 8 >= pre_num, "prefix length too large"
    byte_pos = 0
    while pre_num > 8: # This compares the first complete bytes as bytes if the pre_num is higher than 8 bits
        if prefix[byte_pos] != p_hash[byte_pos]:
            return False
        pre_num = pre_num - 8
        byte_pos = byte_pos + 1
    mask_prefix = (((1 << (8 - pre_num)) - 1) ^ 0xff) & int(prefix[byte_pos].encode('hex'), 16)
    mask_hash = (((1 << (8 - pre_num)) - 1) ^ 0xff) & int(p_hash[byte_pos].encode('hex'), 16)
    if mask_prefix == mask_hash: # In order to check only the first 'prebits' bits of the byte, we mask both bytes to change all bits past 'prebits' length to 0
        return True
    else:
        return False
legendary
Activity: 2053
Merit: 1356
aka tonikt
No I don't think there is anything wrong in my implementation.
Besides non-zero length prefixes, I have tested it quite much.

I can exchange coins via stealth addresses between DarkWallet and my s/w, including several sends in a single tx, and they never got missed.
So I guess it means that my implementation works?

I think it is more likely that Nicolas did something wrong during the first send.
We can try few more times though, if he wants, just to be sure.
I'm always open for more testing.


BTW, @dabura667, are you working on supporting non-zero length prefixes?
I'd like to test it against a different wallet as well.
sr. member
Activity: 475
Merit: 252
piotr, I improved my tests and don't find any bug on it.
I don't find the reason why the first transaction would fail.

I will generate a bunch of transaction to your stealth address later today, and we'll see if they all get through.


maybe piotr you are missing a modulo somewhere in your recovery code. Usually when something in bitcoin works some of the time, I find it's because you didn't mod p somewhere.
hero member
Activity: 714
Merit: 662
piotr, I improved my tests and don't find any bug on it.
I don't find the reason why the first transaction would fail.

I will generate a bunch of transaction to your stealth address later today, and we'll see if they all get through.
hero member
Activity: 714
Merit: 662
Have you done the same error on the previous transaction we made ?
Maybe something does not work right and I need further testing.

No, the previous two transaction were just broken, as far as I can check it.

The third one is fine, though - I received it with no problems and no modifications in my software.

The first one broken.
The second one, I juste did double spent because I sent the third one just after on the same out.

The third one worked. I will make more unit tests.
legendary
Activity: 2053
Merit: 1356
aka tonikt
Have you done the same error on the previous transaction we made ?
Maybe something does not work right and I need further testing.

No, the previous two transaction were just broken, as far as I can check it.

The third one is fine, though - I received it with no problems and no modifications in my software.
hero member
Activity: 714
Merit: 662
With 03b4e5d3cf889840c75f0dd02ebda946151bf37e56cb888c6002c2ae5288e56de7 I'd expect address mvXf4sF4C1w5KgQyasbEWxqVyqbLNtVdnY

So you agree on the generated pubkey ?
You algorithm to transform a pubkey in address does not seems right. (Hash160)
I cross checked mine with brainwallet.
Mine give 119787de5355172ff7934303c06967697699adb2

Oh, I had though the "public key" was the one you put after OP_RETURN.

Never mind, though.

Have you done the same error on the previous transaction we made ?
Maybe something does not work right and I need further testing.
legendary
Activity: 2053
Merit: 1356
aka tonikt
With 03b4e5d3cf889840c75f0dd02ebda946151bf37e56cb888c6002c2ae5288e56de7 I'd expect address mvXf4sF4C1w5KgQyasbEWxqVyqbLNtVdnY

So you agree on the generated pubkey ?
You algorithm to transform a pubkey in address does not seems right. (Hash160)
I cross checked mine with brainwallet.
Mine give 119787de5355172ff7934303c06967697699adb2

Oh, I had though the "public key" was the one you put after OP_RETURN.

Never mind, though.
legendary
Activity: 2053
Merit: 1356
aka tonikt
Yeah, this one is correct!

I'm sending it back in tx c85b654a97f0ed150ff76b6c2ef50b9aa4a1911d7186d815be1c8c02dfcb3a81
hero member
Activity: 714
Merit: 662
With 03b4e5d3cf889840c75f0dd02ebda946151bf37e56cb888c6002c2ae5288e56de7 I'd expect address mvXf4sF4C1w5KgQyasbEWxqVyqbLNtVdnY

So you agree on the generated pubkey ?
You algorithm to transform a pubkey in address does not seems right. (Hash160)
I cross checked mine with brainwallet.
Mine give 119787de5355172ff7934303c06967697699adb2
legendary
Activity: 2053
Merit: 1356
aka tonikt
its private scankey is:
Code:
0361e5c0bff39f18621693da42cd343d60e3e14b4e9eb46b220eb310a484fcebab

It is not a private key, you copied the pubkey.

I made a new transfer on your old stealth:

Stealth Addr : waPV5rHToBq3NoR7y5J9UdE7aUbuqJybNpE88Dve7WgWhEfvMrcuaSvF6tSQ3Fbe8dErL6ks8byJPcp 3QCK2HHviGCSjg42VgMAPJb

Ephem : 9daed68ad37754305e82740a6252cf80765c36d29a55158b1a19ed29914f0cb1
Scan : 026aa1512f0aa20a28ac2ed3fb660aea5cbee45ea6994e4ec790cad001cd5f2643
Spend : 02a60d70cfba37177d8239d018185d864b2bdd0caf5e175fd4454cc006fd2d75ac

PubKey Generated : 03b4e5d3cf889840c75f0dd02ebda946151bf37e56cb888c6002c2ae5288e56de7
ID Generated : 119787de5355172ff7934303c06967697699adb2
Addr : mh7yJrZN6LwCfHymnkxUYJfJxMBQN2HX7R

With 03b4e5d3cf889840c75f0dd02ebda946151bf37e56cb888c6002c2ae5288e56de7 I'd expect address mvXf4sF4C1w5KgQyasbEWxqVyqbLNtVdnY
legendary
Activity: 2053
Merit: 1356
aka tonikt
sorry Smiley

Code:
cc411aab02edcd3bccf484a9ba5280d4a774e6f81eac8ebec9cb1c2e8f73020a
hero member
Activity: 714
Merit: 662
its private scankey is:
Code:
0361e5c0bff39f18621693da42cd343d60e3e14b4e9eb46b220eb310a484fcebab

It is not a private key, you copied the pubkey.

I made a new transfer on your old stealth:

Stealth Addr : waPV5rHToBq3NoR7y5J9UdE7aUbuqJybNpE88Dve7WgWhEfvMrcuaSvF6tSQ3Fbe8dErL6ks8byJPcp 3QCK2HHviGCSjg42VgMAPJb

Ephem : 9daed68ad37754305e82740a6252cf80765c36d29a55158b1a19ed29914f0cb1
Scan : 026aa1512f0aa20a28ac2ed3fb660aea5cbee45ea6994e4ec790cad001cd5f2643
Spend : 02a60d70cfba37177d8239d018185d864b2bdd0caf5e175fd4454cc006fd2d75ac

PubKey Generated : 03b4e5d3cf889840c75f0dd02ebda946151bf37e56cb888c6002c2ae5288e56de7
ID Generated : 119787de5355172ff7934303c06967697699adb2
Addr : mh7yJrZN6LwCfHymnkxUYJfJxMBQN2HX7R

TxId : 266703ce4092b03c4e2585af877eeab6ac6b77d0bf40bf05879e53bedc6e1fbe

I cross checked with tx, my PubKey Generated seems fine.
legendary
Activity: 2053
Merit: 1356
aka tonikt
Can I get your scan private key ? So I can verity with sx and also my framework what address it gives.
Not that one, but I can generate a new address for you.

Code:
waPYjXyrTrvXjZHmMGdqs9YTegpRDpx97H5G3xqLehkgyrrZKsxGCmnwKexpZjXTCskUWwYywdUvrZK7L2vejeVZSYHVns61gm8VfU
Version: 0x2b = 43
Options: 0x00 = 0
scanKey: 0361e5c0bff39f18621693da42cd343d60e3e14b4e9eb46b220eb310a484fcebab
spndKey: 02a60d70cfba37177d8239d018185d864b2bdd0caf5e175fd4454cc006fd2d75ac
sigNeed: 1
Prefix : /0

its private scankey is:
Code:
0361e5c0bff39f18621693da42cd343d60e3e14b4e9eb46b220eb310a484fcebab
hero member
Activity: 714
Merit: 662
Can I get your scan private key ? So I can verity with sx and also my framework what address it gives.
Pages:
Jump to: