The term P2P is a general abbreviation for Peer 2 Peer, which just means you're doing something directly with another peer / person. In this context it refers to trading cryptocurrency directly with a human trading partner instead of trading with an automatic platform. This way of on- and off-ramping cryptocurrency as well as trading it, when used on a good DEX has the potential of being perfectly anonymous. Keep in mind this must not necessarily be the case, since some CEX somehow offer a 'P2P feature' where you trade with another person, but all through this platform, without any of the benefits of a DEX.
On practice, some P2P platform act as escrow to reduce risks faced by buyer and seller. In this case, the platform would use multi-signature address. Depending on the platform, you either must install and configure wallet which support multi-signature feature or the platform simplify it for you where you only need to enter password to encrypt the private key.
Correct; Bisq, which I have most experience with, uses multisig like this. They
changed the way it works a bit a while back, here's the latest wiki entry on disputes:
Sometimes Bisq trades don't go smoothly, and dispute resolution is required to determine an outcome.
Dispute resolution on Bisq has 3 formal levels: trader chat, mediation, and arbitration.
Most issues on Bisq are minor and easily resolved when traders communicate with each other. Mediation is intended to resolve the vast majority of remaining issues. Arbitration is a rare last resort measure for extreme scenarios.
~snip~
Correct; the deposit address they give you, is not actually 'your address', in the way that you don't have control over it. You can only send to it, not take anything back out. Whatever you send there will be credited to your account on this website / platform, but you rely on it working, being reachable, their system security and their honesty to be able to get those funds back out.
This is exactly my question, how can they create a virtual address for a user and receive the fund?
Normally, the same way you and I create Bitcoin addresses. It's not a virtual address, it's a normal Bitcoin address, just that they know the private keys needed to spend any Bitcoin received. They have their own custom backend software that periodically checks those addresses and when a payment arrives, it's credited in your account on an internal database on their servers.
Afterwards, they sweep those coins to some other address of theirs where they collect all the deposits.
Then you can use your 'virtual balance' to trade, stake, whatever and withdraw it. But you don't withdraw through the Bitcoin system, you withdraw through their platform, so you rely on their honesty, integrity, security and uptime. You need to give them a Bitcoin address
you control (i.e. whose private keys you own) so they can send you back your balance. Then it is deducted from their internal database and that's it.
Basically, they are marking public addresses based on a private key, but how does it possible?
Yes, just the normal way Bitcoin works.
https://learnmeabitcoin.com/beginners/keys_addressesWhat do they use or are there any services or API that I can use?
They use Bitcoin Core and proprietary, expensive software. Why do you want access to such software? Do you want to program your own exchange? For this I'm sorry, but it seems you lack the majority of technical knowledge right now.
What I'm trying to do is, create a mobile app to provide some services to my users, but to allow users to pay their fees, I need to create a unique address (USDT TRC20, USDT ERC20, BTC, ETH, Tron, and...) for each user.
I could use some websites like coinpayments but it's a third party and I don't want my users to use third-party services.
Oh I see. If I was in your position, I'd write something around Bitcoin Core
by using its RPC interface to
generate addresses on demand. I'd then save mappings between user accounts and addresses in a local database, like SQLite.
Make sure to also read about
Proper Money Handling (JSON-RPC) while you're at it.
I read that I need to create a node for each network.
Yes, of course, each cryptocurrency network (not necessarily each token) has its own blockchain so you trivially need a node per network, with the whole blockchain of each network and everything it encompasses.
What exactly do you want to do?
He wants a system that generates deposit addresses for users and assigns deposits to their respective user accounts in a database. Just like on a centralized exchange.
Btw, the title is completely misleading; it appears as a question about the difference between CEX and DEX while it's not (at least to me).