Xenforo 2.1 The concept of accepting payments in cryptocurrency directly without intermediaries to your wallets

xenforoaccount

New member
Registered
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.
 
Last edited:

Soft4Win

Developer
Staff member
Moderator
Collaborate
Registered
Joined
Apr 27, 2019
Messages
370
Points
103

Reputation:

Well the idea is pretty good to be honest, but I think it have some drawbacks though. Firstly there is a charge on every transaction which is deducted for the confirmation of transactions. So the final value we receive might not be the same everytime.

The other issue is related to on what basis we should calculate the amount of coin, as digital coins are quite volatile, so they can have different price the next second, so for that a trusted third party would be needed which tells us the exact price each time. I previously developed an addon for Xenforo which shows the current value of each cryptocurrency. So for that I tried various APIs, and the worst part I realized at that moment is every API shows different price for Cryptocurrencies, so which might become a key problem to it.
 

xenforoaccount

New member
Registered
Joined
Jan 28, 2020
Messages
2
Points
13

Reputation:

1. The person that buys product pays from his wallet. There he inputs the amount and above it pays the fee to make this transaction. So seller receives exact sum of coins to his wallet.

2. People that use crypto are ok with it being volatile. In long term bitcoin will only increase in price because it's digital gold. So any API that shows price will work. Yes it's better to have real time numbers. But that's not an exchange. There is nothing bad if current price of bitcoin is 59000, but someone pays you for your product as if bitcoin is 58500 which was several hours ago. Today it's 59 000. Tomorrow it's 58000. In a week it's 65 000. In 2 weeks it's 60 000 again.

The good side here is that if something goes wrong - than it can be fixed lately manually by seller when he reads all transactions.

What i want to add is this:
If rypto protocol of particular network allows to append comment to transaction and this comment can be read on blockchain - then this should be used to place there buyer's id number.
 
Top