- Joined
- Jan 28, 2020
- Messages
- 2
- Points
- 13
Reputation:
In order to accept cryptocurrency no aggregates are needed and there is no need to install bitcoin core to the server.
The principle is very simple. Seller puts in his wallet. Script tells buyer to transfer exact sum of coins to this particular address. Then script checks blockchain if such amount of coins was transferred.
For example let's say we sell some product for 10 dollars. Let's say buyer wants to pay with bitcoin. Script converts 10 dollars into bitcoin and the result is
0.00017241 btc. Then script removes 3 last digits and the price is (this must be implemented as an option: 2 for small sellers, 3 for average and 4 for lots of sales per day)
0.00017 btc. Then script adds unique id number to the end like this
0.00017012
0.00017043
0.00017064
0.00017xxx
Each buyer gets his own price for this product which costs 10 dollars. Each price is unique. Buyer transfers this sum and pays fees to do it. Seller's wallet receives exact sum of coins. The next thing is simply to check blockchain for this particular sum of coins. If such sum is transferred to seller's wallet - then script waits for amount of confirmations needed. And gives buyer his product.
For such small amout as 10 dollars we have 99-999 unique prices. And we need to generate new unique price for each buyer and reserve it for him for 2 days. When the unique price expires - it is removed. And if it's paid - it's removed. After this we can assign this unique price again. If there is no free unique price (everything is reserved, we sell a lot) - then script says buyer to wait and pay later or use different cryptocurrency. Later some of reserved prices will expire. And in other cryptocurrencies there will be different queue.
The queue is a table in DB. Userid (buyer), his subscription he is trying to buy, his unique price , his chosen cryptocurrency, time. So everytime user clicks to buy subscription - new line is generated and stored in this table. Script checks only blockchains from this table and if it finds new incoming transaction it tries to assosiate it with buyer thourgh this table. If it finds match - than this data is deleted, priced is freed, payment for this user is accepted and subscription is given. In 2 days unpaid prices are deleted from table.
Thing is fee for bitcoin is now 20 dollars and noone will pay 10 dollars through this network. They will use altcoins, for example 10 dollars in litecoin is 0.05 ltc - plenty amount for id numbers. And some cryptocurrencies will have more numbers. So it is different for every cryptocurrency.
If cryptonetwork supports appending comment to transaction which is shown on blockchain publicly - than this can be used. Buyer is asked to pay this amount of coins to this wallet and with this comment "fggdggsS" which is unique codephrase for him. Later script will search transaction with this code in order to identify the buyer.
The script should receive exchange rates for the fiat currencies/cryptocurrencies. Real-time data is not needed, just mostly correct rates are ok. Then script should generate unique price in chosen cryptocurrency and monitor blockchain for appearance of such transaction. Everything is implemented without third-party aggregates that accept payments. Everything is implemented without running the bitcoin core itself or any other bulky systems. Everything is implemented in pure php.
This concept allows to create addon for Xenforo (and for everything else) for accepting cryptopayments for all popular networks such as:
Bitcoin
Litecoin
XRP Ripple
Monero
Tron
Bitcoin Cash
etc - all of them directly without asking any permissions.
The principle is very simple. Seller puts in his wallet. Script tells buyer to transfer exact sum of coins to this particular address. Then script checks blockchain if such amount of coins was transferred.
For example let's say we sell some product for 10 dollars. Let's say buyer wants to pay with bitcoin. Script converts 10 dollars into bitcoin and the result is
0.00017241 btc. Then script removes 3 last digits and the price is (this must be implemented as an option: 2 for small sellers, 3 for average and 4 for lots of sales per day)
0.00017 btc. Then script adds unique id number to the end like this
0.00017012
0.00017043
0.00017064
0.00017xxx
Each buyer gets his own price for this product which costs 10 dollars. Each price is unique. Buyer transfers this sum and pays fees to do it. Seller's wallet receives exact sum of coins. The next thing is simply to check blockchain for this particular sum of coins. If such sum is transferred to seller's wallet - then script waits for amount of confirmations needed. And gives buyer his product.
For such small amout as 10 dollars we have 99-999 unique prices. And we need to generate new unique price for each buyer and reserve it for him for 2 days. When the unique price expires - it is removed. And if it's paid - it's removed. After this we can assign this unique price again. If there is no free unique price (everything is reserved, we sell a lot) - then script says buyer to wait and pay later or use different cryptocurrency. Later some of reserved prices will expire. And in other cryptocurrencies there will be different queue.
The queue is a table in DB. Userid (buyer), his subscription he is trying to buy, his unique price , his chosen cryptocurrency, time. So everytime user clicks to buy subscription - new line is generated and stored in this table. Script checks only blockchains from this table and if it finds new incoming transaction it tries to assosiate it with buyer thourgh this table. If it finds match - than this data is deleted, priced is freed, payment for this user is accepted and subscription is given. In 2 days unpaid prices are deleted from table.
Thing is fee for bitcoin is now 20 dollars and noone will pay 10 dollars through this network. They will use altcoins, for example 10 dollars in litecoin is 0.05 ltc - plenty amount for id numbers. And some cryptocurrencies will have more numbers. So it is different for every cryptocurrency.
If cryptonetwork supports appending comment to transaction which is shown on blockchain publicly - than this can be used. Buyer is asked to pay this amount of coins to this wallet and with this comment "fggdggsS" which is unique codephrase for him. Later script will search transaction with this code in order to identify the buyer.
The script should receive exchange rates for the fiat currencies/cryptocurrencies. Real-time data is not needed, just mostly correct rates are ok. Then script should generate unique price in chosen cryptocurrency and monitor blockchain for appearance of such transaction. Everything is implemented without third-party aggregates that accept payments. Everything is implemented without running the bitcoin core itself or any other bulky systems. Everything is implemented in pure php.
This concept allows to create addon for Xenforo (and for everything else) for accepting cryptopayments for all popular networks such as:
Bitcoin
Litecoin
XRP Ripple
Monero
Tron
Bitcoin Cash
etc - all of them directly without asking any permissions.
Last edited: