Bitcoin Forum
September 27, 2024, 09:08:51 AM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Re: How to add add payment button to website and check if transaction was successful on: July 27, 2024, 01:02:45 PM
I googled about Amazon, which is said to be the biggest online shop. Google said that in 2021 Amazon had 2,3 billions of unique visitors.
Just a theoretical question: can BitcoinCore wallet have 2,3 billions unique addresses? :-)
Also, if say wallet can have hundreds and thousands (or millionsof users/buyers), then is it possible to programmatically send money from one BitcoinCore wallet address to another?
What are the commands? And how to set fee/comission there (in command line)?
I am just a newbie in bitcoin world, so sorry for many questions
2  Bitcoin / Development & Technical Discussion / Re: How to add add payment button to website and check if transaction was successful on: July 27, 2024, 12:55:53 PM
You seem to have confused the concept of addresses and wallets. A wallet can have many addresses and the balance that you see is the sum of all of the balance of the addresses in your wallet. You should have a callback for each specific address.
Addresses are independent, which means you would have to send from Address A to B. If you have funds in tons of addresses, then you have to spend from them individually. If you want, you can learn more about Lightning network and use that instead.

1. So, do you mean, that say if I have a website which asks for 1$ for registration, and I would have 100 users registered, and each one would get a unique generated wallet-address, and will send 1$ to that unique address, then if I would want to get that 100$ out of those 100 wallet-addresses, then I woul have to make additional 99 transactions to send money from wallet2...wallet99 to wallet100, right?

2. What is the recommended transaction fee for a transaction. Say, 1$ is sent from one wallet-address to another wallet address, what is common fee?
I have seen in BitcoinCore the possibility to set different fees/commisions. And I see that I can even set fee to 0 (zero). But it says that in such case such transaction will maybe never be processed. What would happen if say I have say 10$ (or, ok, maybe 100$ or 1000$, still have to earn that though), in wallet, and want to send it to some external wallet (from BitcoinCore wallet) - maybe to TrusteePlus (which I already used), but waht if I will set fee to 0 or maybe 1 cent, will it ever be processed? How to know what is the minimum fee to be set so that I can be 100% (or more probability) that it will be processed. I don't care much about time it takes, maybe even if it takes one day to process or few days (like in banks), but my consideration is to have lowest possible fees with guarantee that transaction is ever processed, but not "hangs forever".
And also question is what happens if transaction "hangs" because of absent/0 or too low fee/comission? Is it possible to cancel it? Or such money will be lost forever?
3  Bitcoin / Development & Technical Discussion / Re: How to add add payment button to website and check if transaction was successful on: July 27, 2024, 12:29:32 PM
I also just now thought that there can be easier (?) approach. I amy generate some fixed quantity of wallet addresses, one wallet address for each registered user. So one client/user of webshop would have unique destination address (it will be same for him for any his transactions, but different from destination addresses given/generated for other users/clients/buyers). Thus, if I generate even say 1000 wallet addresees, it is enough for serving 1000 users, and each new user will not know destination address given for any other user. This is good, and even makes it not necessary to keep BitcoinCore CLI/RPC always running. it maybe necessary only sometimes - at time of registering new users. This quick solution makes everything safer, not necessary to always keep BitcoinCore running. moreover, if I don't even ever run BitcoinCore RPC, but always do it on my local computer, say, using BitcoinCore CLI, command line, and then save wallet addresses to some text file, and copy it to server, so then it can use its list of addresses when necessary, assigning to some user a new wallet-address at time when user for a first time ever creates a first order on site. This may work. List of wallet addresses is also have to be saved somewhere. of course it cannot be some simple .txt file which is visible for anyone on website. Maybe it is to be in some protected folder on server, on in some database (it is also password-protected usually).  
4  Bitcoin / Development & Technical Discussion / Re: How to add add payment button to website and check if transaction was successful on: July 27, 2024, 12:12:22 PM
Generally, you would want to configure it with Bitcoin Core and the relevant RPCs. The process would go like this: Customer goes to the payment page -> You generate a unique address for them and set a callback using Bitcoin Core's RPCs -> Listen for callbacks for X confirmations and subsequently confirm their transaction and send whatever goods you're selling.
The easy part is implementing this, but the difficult part is ensuring that it doesn't run into any errors, ie. Bitcoin Core crashing, attackers gaining access to your backend, etc, etc. The easiest way, by far is to just use BitPay as a POS and have them handle it for you. They do have integration with plenty of languages.
Do you really think that using BitPay is easiest? When I see those "third-party" bitcoin companies, which offers something for me as a programmer, I think that it all only becomes more complicated with them. (And worst is that usually they want money for all that complicated stuff: I may spend a lot of time to make it work, reading their documentations, and finally it still will not work, or would be too expensive to use).

You say that
"Generally, you would want to configure it with Bitcoin Core and the relevant RPCs. The process would go like this: Customer goes to the payment page -> You generate a unique address"
OK. Why do you offer to generate unique wallet-addresses for every transaction?

I myself was thinking recently about blockchain.info website, which provides all transactions for anyone. In the beginning I thought that I would ask a buyer to provide his "transaction ID" (and maybe also "FROM-wallet-address" from which he sent money, plus amount). But then I thought that there is one problem. It can happen with non-sincere users/buyers.
For example, some buyer is "too clever", and he understands that he can easily watch all transactions which happened with my destination "TO-wallet-address". I mean, suppose I don't generate wallet-addresses everytime for each transaction, for every user. So, any buyer (or even one who never bought anything on my site), can surf through blockchain.info, and see all previous transactions. And he can just copy-paste some transaction ID which is not his, claiming that it is his (writing its transaction-ID into some input box which I may provide on website for him for this exact order ID). So what can happen, is that some buyer can click "buy this", I give him always same TO-wallet-address (destination in my Bitcoin-Core wallet). Then he goes to list of all transaction which happened with my Destination-wallet-address, and copy paste some transaction-ID which has same amount (same amount which he has to pay, but didn't pay). So, if this is all done without any info like Name Surname etc (KYC - know your client), then he can misuse this openness of information, transactions list on site blockchain.info (or any similar site). Thus, my website/shop can make a mistake and think that he payed money for this order, but in fact it can be some other guy who made a transaction, payed for it honestly, (same amount of money, which, by the way, is not always easy to hack, maybe) - but he didn't have time to confirm his transaction-id by copy-pasting to website/shop into input-field.

Thus, problem can be with dishonest guys who can prened that it were them who payed, and we can never know if that were them or not them, because info in blockchain is anonymous.

So, as I can understand, this problem can be solved by generating new unique wallet-addresses each time for my Bitcoin-Core wallet (using RPC). OK, suppose, I have some my shop at some hosting company (yes, I have to pay to them each year, maybe 20$/year or maybe more). But more complicated here is to have additional always running computer, maybe laptop, which is somewhere at my home (or say office of web-shop), and it is always running Bitcoin-Core-CLI RPC on some IP address x.x.x.x:port. Ok, I understand that it maybe can a problem for security. I don't know. There seems to be special settings file for bitcoin-core cli/rpc, where I can create some user and password, so there seem to be no problem with security, and hacker should be not able to run any command in bitcoin rpc on that IP:port, without knowing login+password. For me bigger problem here seems to be that here in Ukraine we have war (Russia is attacking electric stations etc), so we can have electricity "black-outs", which means there can be some days or hours when there is totally no electricity, so even if I have laptop running bitcoin-RPC at that time, it will discharge after several hours (I don't have some big charging station). And I would need to reconnect to another ISP (Internet service provider), which claims to provide internet even when there is "black-out", but they also use some electricity generators from patrol etc, or some new technologies like optical fibre etc. And that would require to connect router also to some charging station / powerbank etc. And thus it is all more costly. But well, seem to be simpler that using some third-party company in between buyer and seller to do all this.


I have a question. Say, I would configure my bitcoin-core-cli-rpc to generate unique wallet-addresses for each transaction (so it is connected to unique buyer and his order-id, his goods/services there, payment amount etc). I don't understand what would happen to my wallet balance if I have multiple wallet-addresses?

Let's take a simple example. Suppose I sell some test / cheap service/good at my webshop. Price is 1$. Say, User1 registers, places order#1, and bitcoin-rpc generate unique wallet address A. Then he pays that 1$ (and some cents commision), and money goes to my wallet address A.
Then user2 registers, also creates order to buy serice/good for amount of 1$, for him again is generated unique destination (TO) wallet address, he sends 1$ to it, places his confirmation transaction ID (maybe it is not necessary if all wallet addresses are unique, so I can probably check them automatically through blockchain.info say, once every minute. yes, i think they have a limit of 100 such API calls within a minute, so maybe I'ld have to do that later to my Bitcoin Core CLI/RPC at my home/office computer). Anyway, say, user2 made a payment of 1$ to address B, payed some fee, and money goes to address B to my Bitcoin Core wallet.

Question is: if these two wallet addresses are unque, different, but belong to same wallet, does it mean I would see that my wallet now has 2$? I mean, is it like this, that say, I have one room (bank etc), but so many doors (many keys), so I can enter into it through any of doors/keys (wallet addresses), but total amount/balance / sum is same for each of these wallet-addresses?

I mean, if buyer2 will pay 1$ to wallet B, will I automatically have that 2nd dollar in wallet address A? (and vice versa)? Or I will have to send money from wallet B to wallet A (say, it is primary), and thus spend additional money / fee to send from each uniques wallet address (wallets B, C, D, E, F ...) - to wallet-A? How it works? If each wallet address has own unique separate money balance, which is not connected / united with other wallet  address in same wallet, then it is not convenient/good enough, because it means I would have to pay to bitcoin network to send money from hundreds or maybe thousands of wallets addresses to wallet-A address, paying fee for each such additional transaction. If that is so, that one wallet would hold multiple balances (each wallet address has its own separate balance), then it makes services/goods sold on website even more expensive (and that extra cost/fee is to be included into price, which user pays to seller).


5  Bitcoin / Development & Technical Discussion / Re: How to add add payment button to website and check if transaction was successful on: July 20, 2024, 09:10:57 PM
You might want to read https://github.com/bitcoinbook/bitcoinbook for starter.

Thank you. Yes, I'll take a look at it. I see that it uses Python (and I already started learning it a couple of monthes ago when i did OCR, optical characters recognition in Python with Neuro network ;-) interesting, but so hard). Python is great language for Artificial Intelligence.
So i see that it has libraries for Bitcoin. It makes me think I can find similar bitcoin-libraries for C#, which probably will do something similar to what functions at https://www.blockchain.com/ru/explorer/api/blockchain_api are doing. This I can guess from that Python code.

And yes, few days ago I already odwnloaded some Bitcoin books, and started learning. It all takes a lot of time, but is very interesting
6  Bitcoin / Development & Technical Discussion / Re: How to add add payment button to website and check if transaction was successful on: July 20, 2024, 09:01:51 PM
It's not encrypted at all and I recommend you learn more about Bitcoin to avoid misconception which may lead to loss money.

why do you say that Bitcoin is not encrypted at all? By that (encrypted) I mean that all transaction etc are recorded in blockchain, but they don't record private keys, so they can't be stolen from blockchain etc. Yes, it is true that MTGOX, first Exchange for bitcoins was hacked around some 10 years ago (in some 2014), and went bankrupt. And even binance, which seems to replace MTGOX was hacked, but still it is biggest exchange (I didn't like to use them as they have higher minimal transaction).

Well, some guys here - https://www.youtube.com/watch?v=01LEyuNgRSQ saying / showing in russian that they could calculate/get private key somehow. But they pose themselves not as hackers but as company which helps to make bitcoin more secure. So they make vulneravilities researches and publish it, so that developers fix it as soon as possible.

I was shocked to see a command
https://developer.bitcoin.org/reference/rpc/dumpprivkey.html
in BitcoinCore. I don't know what it does, but it seems to extract a private key from wallet address. But when i tried it on some random address, it asked to make wallet first, to enter passwrod to access that address etc, so I think thus that it will not reveal private key to everyone without passwrod. Yes, as I understand, that if I don't make a password for my wallet, then it is indeed saved inside blockchain in un-encrypted form. But adding password makes it protected (its private key). I am not sure if i understand all this right.
7  Bitcoin / Development & Technical Discussion / Re: How to add add payment button to website and check if transaction was successful on: July 20, 2024, 08:49:04 PM
hello, thank you all for you oppinions.
I think that I found a quick solution:
https://www.blockchain.com/ru/explorer/api/blockchain_api
I can simply use:
- https://blockchain.info/rawtx/$tx_hash
- https://blockchain.info/rawaddr/$bitcoin_address
- https://blockchain.info/balance?active=$address
etc, and this seems to be quite great! =-)

Today I for the first time ever bought my first satoshis, sent them to BitcoinCore wallet (it took around half an hour), and I am happy that I can see my transaction, wallet transactions and balance etc at blockchain.info. This is actually solves the security problem with BitcoinCore RPC server which I thought I would need to run on my PC all the time and be available always on network for my website to get some answers about transactions, balance of addresses etc.

My wallet (Trustee Plus) provided transaction ID (hash) after it was successful and I though money coming to my BitcoinCore wallet address. I had to choose wallet address starting with 1 (legacy, but most supported by everyone). Interesting that blockchain.com requires that wallet address also should begin with 1 or 3, so I made good start choosing proper wallet address type (like that which Satoshi Nakamoto used in very first transactions).

What I feel now, is that there are many guys who want to earn money on doing something like bitcoin-payment-system. TrusteePlus took 0.00025 BTC which is quite much amount. I hope I can manually set smaller commisions for my transaction in BitcoinCore.

Conclusion is that it all seems to be so easy that I am really shocked about it. I couldn't imagine that payment system could be so transparent and simple as bitcoin. I start loving bitcoin very much. And probably I'll keep all my money in bitcoins/satoshis instead of bank accounts (because of their inflations etc).
Bitcoin really seems to be a wonderful solution, because I need to work and earn, but I want to be helpful to people to sell their goods/services online as it is "internet era". Non-crypto (non-bitcoin) payment systems / banks and to some advance government have done so much bad things to stop people from making for them easy to earn online (honestly). Bitcoin is great.

Next days and weeks (probably monthes even) I'll code my internet-shop(s) with bitcoin, and if I'll have anything to say /ask soon, I'll do that later. Thank you all again, bitcoiners ;-)
8  Bitcoin / Development & Technical Discussion / How to add add payment button to website and check if transaction was successful on: July 16, 2024, 02:02:43 PM
Hello. I am beginner/junior programmer (asp.net/c#), and want to grow as developer of websites which sell goods & services. I was struggling with adding payment systems (WayForPay and LiqPay) to my website, but after no success decided to switch to accepting bitcoin.

I want to have a possibility on my website to pay to bitcoin-address/wallet. I never used bitcoin before, so I am very new to all this and don't know what to begin with.
Ideally, what I want, is that buyer should be able to pay from his visa/master-card bank-card(s), just by entering xxxx-xxxx-xxxx-xxxx card-number, month/year, and cvv code (or pay using GooglePay or app of his bank, so no need to enter secret cvv code on my site). I am ukrainian, so our currency here is UAH (Ukrainian Hryvnia), so I suggest that there should be some way to pay from UAH-bank-card (visa/mastercard) - to my e-shop's bitcoin wallet address.

I don't know if there are such possibilities to accept visa/mastercard payment to convert it then automatically to bitcoins. I've seen some site which converts USD/EUR to bitcoins, but don't know anything about such for Ukrainan currency.

Well, if it is not common to pay using bank-cards on website to transfer money to bitcoins automatically, maybe it is not a problem, ok.
I am ready to make a way for buyer to pay from his/her bitcoin wallet to bitcoin address of our internet shop.
As I can understand, anyone who want to buy something online using bitcoin, just has to install BitcoinCore wallet (or other? tell me which one is best). And then he can put money into his bitcoin wallet using some "bitcoin ATM" (at least we have one in my city). Or another maybe easier way for buyers is to register on binance (I guesss it is biggest bitcoin exchange company nowadays), and then transfer money from visa/mastercard to his binance wallet address.

But my bigger problem is how then I can, as owner of website, internet-shop (more precisely, I am making websites for my friends, not to sell own goods/services) - how can I integrate bitoin payment to website?
I googled for "bitcoin asp.net" - because my favorite back-end programming language is c# (asp.net), and found GoURL asp.net project. But when I tried to set it up, I noticed that they don't write what kind of bitcoin wallet address types they do support, and when I wrote them email - they didn't even answer (I contacted using a form on site,and sent email which I found there). Also, they take some commision, plus have some kind of minimum amount which I need to receive first from buyers of my site (inet-shop), and that is not very happy news to me.

I also found out that GoURL has wordpress plugin. On wordpress plugin page I also found many bitcoin plugins available. But they are just for PHP in which wordpress  is written.

So, what I want next is to find out that maybe there is some common "bitcoin API", which is always available on some URL (www address), which accepts some incoming requests to get bitcoin transactions/wallets information, and maybe that would be best for me.

What I have found out, is that all bitcoin transactions are recorded online and are open to everyone (but in encrypted form). So there are sites which provide info about given wallet address, and what kind of transactions were done with it, what is the amount of money on that wallet etc.

I would need just a way to record on my website/shop a public key (wallet address) of a buyer/client. Probably I'ld provide a form where he would enter that information. And next there would be a field with my bitoin wallet address, and probably even it's qr-code, so he can scan it with mobile and sent money from his mobile bitcoin app. And I think I'ld need there on website a button "I confirm that I sent money for this good/service" (so there is exact amount of money attached to this transaction). And they I need a way on my server to go online to some web-address, to send there some data to check that there was a transaction from that buyer's wallet address to my wallet address (seller/shop address). And I expect to receive "callback" etc from some "bitcoin API" (or whatever/however it is called), so I can know automatically that mobney indeed was transferred, amount is correct, everything is fine, so I can consider good/service is sold, so I can unlock it on website, give an access to it. I want in the beginning to make some online services, like some cost for registration on site (so customer can read some articles), and maybe there would be a closed "cabinet" of user, where he can download bought files (books etc) - after he sends bitcoins/satoshis for that.


If any bitcoin programmers are reading this, with knowledge about how to implement such bitcoin payment on website (preferrably asp.net, but any other programming language / platfroms / technologies also is OK) - please answer


thank you all in advance
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!