Bitcoin Forum
October 20, 2024, 05:50:11 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: How to add add payment button to website and check if transaction was successful  (Read 314 times)
FatFork
Legendary
*
Offline Offline

Activity: 1764
Merit: 2654


Crypto Swap Exchange


View Profile WWW
July 27, 2024, 04:09:30 PM
 #21

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.

While it's impressive that Amazon had that many unique visitors, it doesn't mean they had 2.3 billion individual customers. A single person can visit a website multiple times, counting as one unique visitor each time.

Just a theoretical question: can BitcoinCore wallet have 2,3 billions unique addresses? :-)

Could a Bitcoin wallet actually hold billions of unique addresses? I mean, in theory, sure.  Bitcoin addresses are random strings of characters - there's no real cap on how many a wallet can generate .  Except maybe if your computer runs out of memory or something and  so technically, the BitcoinCore wallet software could generate addresses forever. However, practically speaking, Core is for individual users or small businesses, not for some company managing a crapload of addresses. I'm sure there are other software solutions that can handle that better.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ranochigo
Legendary
*
Offline Offline

Activity: 3038
Merit: 4420


Crypto Swap Exchange


View Profile
July 29, 2024, 02:28:54 AM
 #22

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).  
Generally, addresses are designed to be one use only. This might be bad for certain users where they wouldn't want to reuse any addresses for transactions. Ideally, each address would be used for each transaction or deposit only once. I'm aware that certain services might permit their users to reuse addresses, but they also allow them to generate new ones.

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?
They count by the number of UTXOs in the transaction, or otherwise known as Unspent Transaction Outputs. You can have multiple UTXOs from different addresses in the same transaction, but that would mean your transaction gets bigger.

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?
You would have to calculate it yourself. See how much the size of a transaction would be suppose you have 10 inputs and 1 output. If it doesn't get confirmed, then you would be able to spend it again.

Most websites have their own implementation of Bitcoin Core or a variation of it which allows them to scale. Bitcoin Core can absolutely handle tons of addresses but it is limited by your system resources. You should spend time learning more about the fundamental workings of Bitcoin, and the implementation of Bitcoin Core before thinking about implementing a payment system on your website. If you can't understand how it works fully, then I recommend that you should just use a ready made POS like BitPay.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!