Bitcoin Forum
November 19, 2017, 01:47:48 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: « 1 [2]  All
  Print  
Author Topic: Using BitcoinJ in .NET (C#)  (Read 6850 times)
Nicolas Dorier
Hero Member
*****
Offline Offline

Activity: 686


View Profile
August 08, 2014, 11:46:41 PM
 #21

Although I could successfully create a console app, when I tried to import the references to the Windows Store app, it gave me compile errors because some references could not be resolved. This means that, since Windows Store has a limited .NET API, it can't use some of the features this library is using (at least the way IKVM generated it).

Either I find a way to generate a Windows Store compatible library, or I'm afraid I'll have to manually port the library.

I stopped developing for Windows Store because so many important methods are missing from the Windows Store version of .NET. System.Security.Cryptography, which was required for my app is a good example.

I think there may be alternative methods, but they made it very hard to port programs by not using the same ones.  Hmm, I wonder why there are no good Windows Store apps?  Roll Eyes

Razick, porting NBitcoin to Portable library is not complicated and definitively feasable thanks to the unit tests.
I say that because I did it for a customer of mine, it took approximately 7H.

To do that, you need to fetch the sources of BouncyCastle, and strip every thing that does not compile in portable.
Then, do the same with NBitcoin, strip every class you don't need.
Then, do the same with NBitcoin.Tests, so you can be sure you did not broke anything by porting or stripping too much. Run tests with Core and UnitTests traits.

For my customer, NBitcoin works on xamarin (IOS, Android, Windows Phone). I wanted to make it open source directly, but he pays the bill, so he got a private copy of this work. I might release the code in open source when the project is finished if he agrees.
If not, I will redo the port from scratch.

Some goodies : NBitcoin signature verification and generation, and all crypto ECC operations are manifold more performant thanks to the most recent version of BouncyCastle Smiley
All security stuff is implemented in BouncyCastle so no dependance on System.Security.Crypto.

One problematic thing is the Random generation, RandomUtils will not compile because generating a random number with enough entropy is plateform specific. Luckily, for the sig creation I implement determinitstic RFC. (http://tools.ietf.org/html/rfc6979)

Bitcoin address 15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe
1511056068
Hero Member
*
Offline Offline

Posts: 1511056068

View Profile Personal Message (Offline)

Ignore
1511056068
Reply with quote  #2

1511056068
Report to moderator
1511056068
Hero Member
*
Offline Offline

Posts: 1511056068

View Profile Personal Message (Offline)

Ignore
1511056068
Reply with quote  #2

1511056068
Report to moderator
1511056068
Hero Member
*
Offline Offline

Posts: 1511056068

View Profile Personal Message (Offline)

Ignore
1511056068
Reply with quote  #2

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

Posts: 1511056068

View Profile Personal Message (Offline)

Ignore
1511056068
Reply with quote  #2

1511056068
Report to moderator
garyramsey389
Newbie
*
Offline Offline

Activity: 9


View Profile
November 07, 2014, 01:55:40 PM
 #22

Hello! I'm trying to develop a Bitcoin app for the Windows Store. I'm doing this like a hobby, so in many things I'm still new to this.
I've seen that many programs use BitcoinJ, but as the name implies, it's for Java. I've found some .NET ports, but they are from 2011, so I don't think they are that reliable.
But then I found about a program called IKVM, which can convert a Java library to a .NET one.

As this is a very delicate subject (an app that handles money), I would like to ask you: Is it OK if I follow this approach? Or maybe I should manually port it to .NET? (which will take me a long time since I'm still in university)

What are your opinions?


Thanks for sharing this nice and informative post...
Pages: « 1 [2]  All
  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!