I want to build a marketplace, so there is a buyer and a seller. So when a buyer buys something from the seller I take the fee. Thus buyers money goes to my account like (10%) and the rest to the seller
Most of marketplaces that provide such services are centralized, meaning that you do the following:
- Create an account in the marketplace.
- When a user purchases a certain amount from through you, 10% goes to you.
- After a period of time, a week or a month, you can review your balance and withdraw all amounts.
Thus, the development is in the background by managing the databases, where 10% is added as an update in the database, and in the end all the money and the possibility of withdrawing to your Bitcoin address are collected.
This can be done individually for each transaction, but in this case the user will be given two addresses, the first containing the amount and the second containing 10% of that amount.