Title: C#, NBitcoin and XPubkey Post by: galgitron on November 09, 2015, 07:30:10 PM I'm attempting to write an algorithm that generates public bitcoin addresses from a known xpubkey. The key I'm using for testing can be found at blockchain.info at
https://blockchain.info/xpub/xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz I'm trying something like this to generate the address on the path 0,0,0, as below: Code: var pubkey = new ExtPubKey(Encoding.ASCII.GetBytes("6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz")); I'm not fully understanding something because I get a 'Invalid point encoding 103' when trying to instantiate the ExtPubKey. Does anyone have working sample code? Title: Re: C#, NBitcoin and XPubkey Post by: lontivero on November 15, 2015, 12:23:38 AM Well, there are a couple of things wrong in your code:
Now, try this: Code: var pubkey = ExtPubKey.Parse("xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz"); BTW, I recommed you to try things in testnet first. Title: Re: C#, NBitcoin and XPubkey Post by: galgitron on November 17, 2015, 02:54:14 PM That was it :) Much appreciated my friend
|