Author

Topic: Accepting Bitcoin using ASP.NET ? (Read 2969 times)

newbie
Activity: 1
Merit: 0
December 21, 2015, 09:21:55 AM
#7
You can scan the blockchain manually, using NBitcoin library (https://github.com/MetacoSA/NBitcoin). You'll need a bitcoind running on your server.
Or you can simply trust some of the "big players", that are providing statistics information (as mentioned above).

Ease or reliability - that is the question, that you should ask as a developer.
staff
Activity: 3500
Merit: 6152
December 21, 2015, 07:34:24 AM
#6
Quote
I'm not even sure what's the difference between running Bitcoin Core itself and running Coinbase.com API or BlockTrail/Blockchain etc ... ?

The difference is they do it vs you do it.  They could have a website / API that returns anything.  Its not in their best interest to do so, but they could get hacked, a software bug etc.

If you stand up you're own infrastructure and report on your own daemon, then you only have to trust yourself, and the build of bitcoin core.

Quote
Very curious what do you mean by "trust them to report correct" ? can they report that I received X on the transaction while I received Y ?

They could do what ever they like.  How are you to know that query on address a will give a correct result?  If you believe they're reputable and their systems are working correctly, then fine.

Maybe think about it like this.  You need to report on the weather in your favourite city.  You could call an API like weather.com for the information.  Or you could setup your own monitoring system and report on that.

Make sense , and on the same time It's scary little bit and will make me think more then once before using an API of any website . Well .. thanks for your explanation mate , I hope I will successfully setup everything up .
hero member
Activity: 765
Merit: 503
December 21, 2015, 01:58:44 AM
#5
Quote
I'm not even sure what's the difference between running Bitcoin Core itself and running Coinbase.com API or BlockTrail/Blockchain etc ... ?

The difference is they do it vs you do it.  They could have a website / API that returns anything.  Its not in their best interest to do so, but they could get hacked, a software bug etc.

If you stand up you're own infrastructure and report on your own daemon, then you only have to trust yourself, and the build of bitcoin core.

Quote
Very curious what do you mean by "trust them to report correct" ? can they report that I received X on the transaction while I received Y ?

They could do what ever they like.  How are you to know that query on address a will give a correct result?  If you believe they're reputable and their systems are working correctly, then fine.

Maybe think about it like this.  You need to report on the weather in your favourite city.  You could call an API like weather.com for the information.  Or you could setup your own monitoring system and report on that.
staff
Activity: 3500
Merit: 6152
December 21, 2015, 12:18:11 AM
#4
Do you want to use the Bitcoin core or an api like the one from Coinbase.com?
When the last is the case then it is not a big deal to implement what you require. The api is documented very well.

I'm not even sure what's the difference between running Bitcoin Core itself and running Coinbase.com API or BlockTrail/Blockchain etc ... ?


I'm running a website on ASP.NET C# and it's connected to a MSSQL Database . What I want to do is when people send BTC to an address (I don't really care if the care is the same or keep generating new one each time) , so once they send BTC .. I want to execute a MSSQL Query into my database to give them some sort of points etc ... ? Who think he can help on this task pls

3 ways, in order of ease:

You will have to write a service, worker processor etc to poll the address looking for new transactions.

1.  Use Blockchain.info.  They have a nugget package and good enough for small transactions, but you're trusting them to report correct:
Code:

        public ActionResult Wallet()
        {
            ViewBag.Address = System.Configuration.ConfigurationManager.AppSettings["WalletAddress"];

            Info.Blockchain.API.BlockExplorer.BlockExplorer ex = new Info.Blockchain.API.BlockExplorer.BlockExplorer();
            var address = ex.GetAddress(System.Configuration.ConfigurationManager.AppSettings["WalletAddress"]);

            Decimal amount = Convert.ToDecimal(address.FinalBalance / 100000000.0M);
            String balance = String.Format("{0:0.######}", amount);
            ViewBag.Balance = balance;

            return View();
        }

2.  Same approach, but poll your own bitcoind instance.  There are a few .net wrappers for bitcoind. 
  • Have a server running bitcoind in server mode
  • Set the credentials and configs and firewalls up
  • Use JSON RPC calls (web client will do) to query an address that bitcoind hosts

3.  Roll your own blockchain passer and keep updating it.  There are a few .net ones out there, but too much over kill for a few tx a day.

Hope this helps.

Very curious what do you mean by "trust them to report correct" ? can they report that I received X on the transaction while I received Y ?
hero member
Activity: 765
Merit: 503
December 20, 2015, 06:01:35 PM
#3
I'm running a website on ASP.NET C# and it's connected to a MSSQL Database . What I want to do is when people send BTC to an address (I don't really care if the care is the same or keep generating new one each time) , so once they send BTC .. I want to execute a MSSQL Query into my database to give them some sort of points etc ... ? Who think he can help on this task pls

3 ways, in order of ease:

You will have to write a service, worker processor etc to poll the address looking for new transactions.

1.  Use Blockchain.info.  They have a nugget package and good enough for small transactions, but you're trusting them to report correct:
Code:
        public ActionResult Wallet()
        {
            ViewBag.Address = System.Configuration.ConfigurationManager.AppSettings["WalletAddress"];

            Info.Blockchain.API.BlockExplorer.BlockExplorer ex = new Info.Blockchain.API.BlockExplorer.BlockExplorer();
            var address = ex.GetAddress(System.Configuration.ConfigurationManager.AppSettings["WalletAddress"]);

            Decimal amount = Convert.ToDecimal(address.FinalBalance / 100000000.0M);
            String balance = String.Format("{0:0.######}", amount);
            ViewBag.Balance = balance;

            return View();
        }

2.  Same approach, but poll your own bitcoind instance.  There are a few .net wrappers for bitcoind. 
  • Have a server running bitcoind in server mode
  • Set the credentials and configs and firewalls up
  • Use JSON RPC calls (web client will do) to query an address that bitcoind hosts

3.  Roll your own blockchain passer and keep updating it.  There are a few .net ones out there, but too much over kill for a few tx a day.

Hope this helps.
tyz
legendary
Activity: 3360
Merit: 1533
December 20, 2015, 04:48:25 PM
#2
Do you want to use the Bitcoin core or an api like the one from Coinbase.com?
When the last is the case then it is not a big deal to implement what you require. The api is documented very well.
staff
Activity: 3500
Merit: 6152
December 20, 2015, 09:27:26 AM
#1
I'm running a website on ASP.NET C# and it's connected to a MSSQL Database . What I want to do is when people send BTC to an address (I don't really care if the care is the same or keep generating new one each time) , so once they send BTC .. I want to execute a MSSQL Query into my database to give them some sort of points etc ... ? Who think he can help on this task pls
Jump to: