Bitcoin Forum
May 01, 2024, 01:47:20 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Many adresses for many coins. Building exchange  (Read 147 times)
usmerk66 (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 1


View Profile
March 15, 2023, 04:15:58 PM
 #1

Im making an exchange like sideshift.ai.
I have 2 questions.


1. How do i generate a new deposit adress for each new user and each coin?

Like if you want to exchange BTC to ETH, you will get a BTC adress/QR code to send to.
But that unique adress needs to go to my binance account, or at least the deposit has to go to binance account. 
Is there like any API or so that generates sub adresses and then binding them all to my static btc adress on binance?

2. When a user send crypto to the deposit adress, he will get a notification that they are accepted by the blockchain network.
 Something like:
" thanks for your deposit, We will now exchange your BTC and send 0.124 ETH  to your wallet. You can now close your browser if you want".


I will have like 50 different coins in total, so not only BTC and ETH.

1714528040
Hero Member
*
Offline Offline

Posts: 1714528040

View Profile Personal Message (Offline)

Ignore
1714528040
Reply with quote  #2

1714528040
Report to moderator
1714528040
Hero Member
*
Offline Offline

Posts: 1714528040

View Profile Personal Message (Offline)

Ignore
1714528040
Reply with quote  #2

1714528040
Report to moderator
1714528040
Hero Member
*
Offline Offline

Posts: 1714528040

View Profile Personal Message (Offline)

Ignore
1714528040
Reply with quote  #2

1714528040
Report to moderator
If you see garbage posts (off-topic, trolling, spam, no point, etc.), use the "report to moderator" links. All reports are investigated, though you will rarely be contacted about your reports.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714528040
Hero Member
*
Offline Offline

Posts: 1714528040

View Profile Personal Message (Offline)

Ignore
1714528040
Reply with quote  #2

1714528040
Report to moderator
1714528040
Hero Member
*
Offline Offline

Posts: 1714528040

View Profile Personal Message (Offline)

Ignore
1714528040
Reply with quote  #2

1714528040
Report to moderator
1714528040
Hero Member
*
Offline Offline

Posts: 1714528040

View Profile Personal Message (Offline)

Ignore
1714528040
Reply with quote  #2

1714528040
Report to moderator
OmegaStarScream
Staff
Legendary
*
Offline Offline

Activity: 3458
Merit: 6105



View Profile
March 15, 2023, 04:23:54 PM
 #2

AFAIK, there's no way to generate a new address using Binance API.

What you need to do is run your own node, and communicate with it.

1. A user chooses the trading pairs.
2. You generate a bitcoin address for him.
3. Wait for a certain number of confirmations.
4. Send him the money.

I understand what you're trying to do, and one solution would be to once you're done with #3, you transfer the funds directly to Binance, and from there, you can exchange the funds and withdraw them however, I don't think this is the best solution because it will result into a very bad experience (since the user has to wait more than he should).

It's better to have some liquidity aside on Binance at first if this is how you want to do it and instead of sending each transaction you receive directly to Binance, you wait until you get a few, then batch everything to Binance. This should also save you some fees.

█▀▀▀











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











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

Activity: 3290
Merit: 16577


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
March 15, 2023, 04:38:16 PM
Merited by TryNinja (1)
 #3

Im making an exchange
~
How do i generate a new deposit adress for each new user
If you have to ask this, you shouldn't build an exchange.

usmerk66 (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 1


View Profile
March 15, 2023, 05:35:17 PM
 #4

Im making an exchange
~
How do i generate a new deposit adress for each new user
If you have to ask this, you shouldn't build an exchange.

Wow, you are talking so much shit.

Its not rocketscience making a small exchange, and its even easier to maintain when its all set up.

It like i would say" if you have to ask how to fix a car, you shouldnt drive one".
usmerk66 (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 1


View Profile
March 15, 2023, 05:54:54 PM
 #5

AFAIK, there's no way to generate a new address using Binance API.

What you need to do is run your own node, and communicate with it.

1. A user chooses the trading pairs.
2. You generate a bitcoin address for him.
3. Wait for a certain number of confirmations.
4. Send him the money.

I understand what you're trying to do, and one solution would be to once you're done with #3, you transfer the funds directly to Binance, and from there, you can exchange the funds and withdraw them however, I don't think this is the best solution because it will result into a very bad experience (since the user has to wait more than he should).

It's better to have some liquidity aside on Binance at first if this is how you want to do it and instead of sending each transaction you receive directly to Binance, you wait until you get a few, then batch everything to Binance. This should also save you some fees.

The user will have a uniqe order-id, so i was thinking if i could log that, plus his reciving adress and the amount he sent.
Then i would get notification when his coins arrive to my binance account and then just send him back 5% less ETH if i charged a 5% fee.

But he still would not get any notification that i have recived his coins while he is waiting or me to complete the exchange. 


I like you 1-4 description, thats exactly how i want it to work.
Do i need a node for each coin, like if i have 50 different coins, do i need a node for each one?
And what could that cost?



OmegaStarScream
Staff
Legendary
*
Offline Offline

Activity: 3458
Merit: 6105



View Profile
March 16, 2023, 02:48:33 PM
 #6

The user will have a uniqe order-id, so i was thinking if i could log that, plus his reciving adress and the amount he sent.
Then i would get notification when his coins arrive to my binance account and then just send him back 5% less ETH if i charged a 5% fee.

But he still would not get any notification that i have recived his coins while he is waiting or me to complete the exchange. 

I like you 1-4 description, thats exactly how i want it to work.
Do i need a node for each coin, like if i have 50 different coins, do i need a node for each one?
And what could that cost?

You should first confirm if Binance allows generating multiple addresses but as I said, I don't believe they do and even if they did, you will probably need to deal with the API limits as well, which doesn't help either.

The approach is correct though.
You create an address for the user and link it with the OrderID -> Wait until the address receives a transaction -> check for the amount -> wait for a few confirmations -> notify the user.

And yes, you would need different nodes for different coins. But if you're going to deal mainly with evm compatible networks then I would suggest you look into Alchemy, Infura, and Quicknode. They all have free tiers (there are limits on how many requests you can make, but it's still good) so maybe you can start with that at first and then upgrade.

As for your comment above, then yes, an instant exchange like Sideshift may be easier to develop and maintain compared to a CEX, but you should still take security seriously.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Learn Bitcoin
Hero Member
*****
Offline Offline

Activity: 504
Merit: 807


#SWGT CERTIK Audited


View Profile WWW
March 16, 2023, 05:32:00 PM
 #7

Would you mind doing your own research about block.io
I feel like this wallet website could meet your needs.

odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3211



View Profile
March 17, 2023, 03:53:40 AM
 #8

I'm curious why Binance, which is an exchange, needed for your exchange.

Off the top of my head, here is a summary of how to create a simple exchange where you set the prices instead of using a market (because it is easier).

  • 1. Create a wallet for each kind of coin.
  • 2. Create a database for trades. Each entry would contain the amounts for each coin and their receiving addresses.
  • 3. Create a site that allows a person to create a trade.
    • 3a. The site gets an address from the wallet for the coin the customer is sending and shows it to the customer.
    • 3b. The set gets an address from customer for the coins the customer is buying.
    • 3c. The site records the transaction in the database.
  • 4. Create a backend that periodically scans the transaction database, gets the receiving addresses for the pending trades and checks the wallets to see if the coins have arrived. When the coins for a trade have arrived, it sends the customer's coins to the address they provided.

There you go. No need for Binance. Is that what you are doing?


Of course, I'm sure that there is a lot more involved in the implementation. You don't want to get hacked or end up like Mt. Gox.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
usmerk66 (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 1


View Profile
March 17, 2023, 09:03:00 PM
 #9

I'm curious why Binance, which is an exchange, needed for your exchange.

Off the top of my head, here is a summary of how to create a simple exchange where you set the prices instead of using a market (because it is easier).

  • 1. Create a wallet for each kind of coin.
  • 2. Create a database for trades. Each entry would contain the amounts for each coin and their receiving addresses.
  • 3. Create a site that allows a person to create a trade.
    • 3a. The site gets an address from the wallet for the coin the customer is sending and shows it to the customer.
    • 3b. The set gets an address from customer for the coins the customer is buying.
    • 3c. The site records the transaction in the database.
  • 4. Create a backend that periodically scans the transaction database, gets the receiving addresses for the pending trades and checks the wallets to see if the coins have arrived. When the coins for a trade have arrived, it sends the customer's coins to the address they provided.

There you go. No need for Binance. Is that what you are doing?


Of course, I'm sure that there is a lot more involved in the implementation. You don't want to get hacked or end up like Mt. Gox.



I keep my funds on a exchange, and i need an exchange to be able to echange the users crypto that is sent to me.

How would i exchange the users crypto for like 1% fee if i didnt use an exchange?
odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3211



View Profile
March 18, 2023, 05:49:20 AM
 #10

I keep my funds on a exchange, and i need an exchange to be able to echange the users crypto that is sent to me.

How would i exchange the users crypto for like 1% fee if i didnt use an exchange?

If you keep your funds in your own wallets, then you don't need an exchange. And charging 1% is easy. If the pair trades at 1 to 100, then you exchange at 1 to 99 or 1 to 101.

But I see what you are doing. You don't want to hold any inventory and you want to act as a broker between the customer and the exchange.

Many wallets do what you want to do. They set up a relationship with an exchange that allows them to be a broker. Checkout Binance Connect

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
Pages: [1]
  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!