Pages:
Author

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

legendary
Activity: 2053
Merit: 1356
aka tonikt

I don't think its correct.

With the ephemkey key of:
Code:
024272e119d08015609528fb6e9841d9a432fe0d013d60d4f332104808088e7084

And my stealth address:
Code:
waPV5rHToBq3NoR7y5J9UdE7aUbuqJybNpE88Dve7WgWhEfvMrcuaSvF6tSQ3Fbe8dErL6ks8byJPcp3QCK2HHviGCSjg42VgMAPJb
Version: 0x2b = 43
Options: 0x00 = 0
scanKey: 026aa1512f0aa20a28ac2ed3fb660aea5cbee45ea6994e4ec790cad001cd5f2643
spndKey: 02a60d70cfba37177d8239d018185d864b2bdd0caf5e175fd4454cc006fd2d75ac
sigNeed: 1
Prefix : /0

... I would be expecting the next output going to mr7F6ALhcQhZay1ufXipnESkLEB5xXuV9S
Your output goes to mk2BkyJyE8Fgzs9zpCodpG14TJQHpvUJ9s
legendary
Activity: 2053
Merit: 1356
aka tonikt
ok - as soon as it arrives.
but it hasn't yet.
hero member
Activity: 714
Merit: 662
sent, send back to msj42CCGruhRsFrGATiUuh25dtxYtnpbTx (tpfaucet)
hero member
Activity: 714
Merit: 662
Thanks for the seed, I will send the transaction.
I signed before adding the TxOut -_-

Quote
0100000001695f9c647d044563d2fff95fba1bd5cf1d35d75611ddbd8b1da80a4dff7aa8a000000 0006b483045022100ee96d1dbe442c1b0997526e3e66d188a9014bd0b9f39262498b2c8484520d3 49022070c0fb15145a453cf2151f7ee60d675fbf047afba1d0058ac704589fe07fdcc6012102cce a45d5eb89ea63dee2dd567beef6dd38b2edb3ebf3d85ef45c537ff1af1bbcffffffff0200000000 00000000286a26060000000003de307f3903d0cf32509c2964ea8fca2be9640dd14bc1233856aa8 0967e4e0debc056fe03000000001976a9140d31b807b4ce74cd9e1f7d0c888abbed8e30584788ac 00000000

legendary
Activity: 2053
Merit: 1356
aka tonikt
Try to send this transaction to the TestNet, it should works if I did not made a mistake on the sig part.

It says the signature of your tx is invalid.

Here is the list of 90 testnet peers from my db:

Code:
    95.85.39.28   18333
   46.4.106.234   18333
  94.102.53.181   18333
  5.135.159.139   18333
188.226.138.211   18333
188.165.238.173   18333
   46.28.204.15   18333
109.201.135.216   18333
      5.9.2.145   18333
   46.182.106.2   18333
109.201.154.201   18333
188.165.246.217   18333
  108.62.62.235   18333
  184.107.180.2   18333
  198.50.215.81   18333
 188.226.176.87   18333
   75.6.237.138   18333
   93.93.135.12   18333
  54.208.21.132   18333
107.170.107.245   18333
188.230.215.236   18333
   46.28.207.68   18333
 178.63.106.253   18333
  74.207.249.18   18333
    54.209.7.19   18333
254.112.255.114   18333
  162.216.6.146   18333
  88.198.20.152   18333
  54.72.131.178   18333
     54.84.19.8   18333
162.243.123.220   18333
  87.230.26.205   18333
 178.63.106.250   18333
    78.46.97.16   18333
162.243.141.246   18333
   221.249.5.50   18333
   69.85.93.216   18333
     5.9.119.49   18333
192.161.182.207   18333
   37.59.58.130   18333
  107.170.35.88   18333
 144.76.175.228   18333
 15.125.110.219   18333
    178.63.14.7   18333
   95.85.15.189   18333
117.241.136.198   18333
 192.241.204.12   18333
 188.122.92.134   18333
 148.251.11.118   18333
  54.206.106.94   18333
 134.60.102.116   18333
 54.215.172.225   18333
   85.153.13.35   18333
  119.81.66.229   18333
   176.9.24.110   18333
 54.252.141.122   18333
199.231.187.226   18333
162.242.155.221   18333
  23.253.92.253   18333
  116.24.15.116   18333
 91.121.140.111   18333
    46.4.120.71   18333
   83.80.206.63   18333
 94.190.126.105   18333
 107.170.99.148   18333
148.251.236.175   18333
 198.50.156.105   18333
 137.117.217.85   18333
 137.135.219.45   18333
  212.108.45.54   18333
 87.195.172.209   18333
 115.118.49.234   18333
   194.18.61.26   18333
  41.164.148.82   18333
  93.172.61.180   18333
   85.17.26.225   18333
212.219.220.118   18333
 137.190.79.169   18333
   63.87.77.156   18333
 146.185.169.56   18333
  86.27.247.219   18333
162.242.154.199   18333
151.236.216.148   18333
   71.94.45.245   18333
  176.111.59.60   18333
  80.86.232.251   18333
     31.7.56.82   18333
107.170.113.154   18333
   178.17.8.128   18333
105.224.102.106   18333
hero member
Activity: 714
Merit: 662
yes it supports prefix.
TestNet is unavailable at my place, the dns seed nodes seems down ?!

Try to send this transaction to the TestNet, it should works if I did not made a mistake on the sig part.

Quote
0100000001695f9c647d044563d2fff95fba1bd5cf1d35d75611ddbd8b1da80a4dff7aa8a000000 0006a47304402200e583af51ef57334f0c830e85bb809c7a23f4fbdd6d5557dbec1a2216c578bee 02203c54f1c2205ab0c21a511cbd1a2006bc339693d329cee7fb881aae44c6323dee012102ccea4 5d5eb89ea63dee2dd567beef6dd38b2edb3ebf3d85ef45c537ff1af1bbcffffffff020000000000 000000286a26060000000002704f9c99117ba90b162859e1f5f21c7e1805bc6c0594cc4e5a3dadf adf2c17bbc056fe03000000001976a9148f1516c7c20207a22940133f878351ac3681b56b88ac00 000000

All of these are down for me

Quote
vFixedSeeds.Add(new NetworkAddress()
{
   Endpoint = new IPEndPoint(IPAddress.Parse("109.123.116.245").MapToIPv6(), 18333)
});
vSeeds.Clear();
vSeeds.Add(new DNSSeedData("bitcoin.petertodd.org", "testnet-seed.bitcoin.petertodd.org"));
vSeeds.Add(new DNSSeedData("bluematt.me", "testnet-seed.bluematt.me"));
vSeeds.Add(new DNSSeedData("Blockexplorer.com", "blockexplorer.com"));
legendary
Activity: 2053
Merit: 1356
aka tonikt
cool.  let's test it. can you send me some test coins and give the address where to send them back?

Code:
waPV5rHToBq3NoR7y5J9UdE7aUbuqJybNpE88Dve7WgWhEfvMrcuaSvF6tSQ3Fbe8dErL6ks8byJPcp3QCK2HHviGCSjg42VgMAPJb

btw, do you support prefix length other than 0?
hero member
Activity: 714
Merit: 662
hero member
Activity: 714
Merit: 662
I finished implementing StealthAddress in NBitcoin.

Quote
Key scan = new Key();
Key spend = new Key();
BitcoinStealthAddress address = spend.PukKey.CreateStealthAddress(scan.PubKey,Network.Main);
//The receiver publish the address on a forum or whatever....
//Sender then create payment
Key ephem = new Key(); //Optional, CreatePayment create one if not specified
StealthPayment payment = address.CreatePayment(ephem);
//In you want to include the payment to a transaction
Transaction tx = new Transaction();
payment.AddToTransaction(tx);
//Receiver receive the payment via the block chain with (address.Bitfield.GetPayments(tx))
Key key = spend.Uncover(scan,payment.Metadata.EphemKey);
//Or, if you just want the public key (equals to key.PubKey)
PubKey pubkey = spend.PubKey.UncoverReceiver(scan, payment.Metadata.EphemKey);

You can replay these steps in parallel with sx to verify the implementation.
There is a deterministic unit test for that : https://github.com/NicolasDorier/NBitcoin/blob/master/NBitcoin.Tests/StealthAddressTests.cs#L179

Enjoy,

Github : https://github.com/NicolasDorier/NBitcoin
Nuget : Install-Package NBitcoin
Pages:
Jump to: