9

I want to start a BTC market. I understand all the ways to go about creating a site, it's just the payment implementation which confuses me. I want multi-sig transactions capable between my users on site. If I understand correctly, multi-sig addresses are just special wallets anyways which require a certain fulfillment (2 out of three keys, for example) to go through.

How can I implement a system like this for my users on my server? So I can allow users to trade without the middle man if possible, yet also have the opportunity for an escrow moderation in case something happens? In the end a small percentage of market fees can be charged?

I'm new to Bitcoin programming but I'm assuming you simply have your web application interact with server daemons which dynamically create multi-sig addresses on demand for your users and somehow give them each a key, and leave a key for escrow moderation? And that would probably be all you'd have to do?

3
  • If it's going to be a BTC market you control then you should just deem yourself as the escrow and let users transact through you just as silk road did. It's admirable that you want to remove trust from the equation but trying to create a system in which users send funds to each other with your permission is an unnecessary incumbent. If you went rogue and tried to spend the btc to yourself, my customer tries to send the cash to himself and I try to take the money back then the coins would just end up in limbo. A shady escrow admin is unlikely to reimburse users simply because the btc is wasted,
    – derrend
    May 23, 2016 at 0:55
  • That's a good point. Are there any frameworks you'd recommend for taking and handling payments as such?
    – tacoma
    May 23, 2016 at 3:21
  • 1
    Depends on your choice of language, I use Django because python is easy. If you like python then checkout the pycoin library. blockchain.info have a good python library for accessing their api but if you'd prefer to access bitcoind locally then python-bitcoinlib is useful for that :)
    – derrend
    May 23, 2016 at 4:37

1 Answer 1

3

You basically got it.
create 2-of-3 multisig addresses (meaning needing two out of three signatures)
1 is for the buyer, 1 is for the seller, and 1 is for the mediator

  1. buyer sends money to the multisig address, commiting the funds to the transaction

  2. if the transaction goes well, buyer sends a signed transaction spending the multisig output to the seller and sends the transaction to the seller, the seller signs the tx and broadcasts it

  3. if buyer is unhappy he/she can try to work out the matter with the seller till they agree on any split of the money, it would involve same steps as in (2) except now the money is divided (any percentage) between the buyer and the seller

  4. if the buyer and seller can't work things out, the mediator steps in and after a decision is made, the money is split between the three addresses (buyer, seller, fee for mediator)

So those are the conceptual steps to implement the scheme

4
  • At step #2, in detail, how can the buyer send the signed transaction to the seller?
    – anhldbk
    Feb 4, 2017 at 8:30
  • the buyer can send the transaction via email for example
    – Albert S
    Feb 4, 2017 at 20:15
  • So the receiver will have to check if the transaction is signed by the sender manually, right? And there's no support for collectively signing a transaction by Bitcoin network?
    – anhldbk
    Feb 5, 2017 at 5:47
  • @anhldbk I am not sure about that, perhaps post a question?
    – Albert S
    Feb 5, 2017 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.