trading nmc for btc in a completely distributed way

Post Reply
jtimon
Posts: 27
Joined: Fri Jul 22, 2011 5:36 pm
os: linux

trading nmc for btc in a completely distributed way

Post by jtimon »

EDIT: it seems that there's a better solution than my proposal that doesn't involves the creation of a new chain.
----------------------------
Hi, I have proposed in the bitcoin forum a method for distributed trading between block chain currencies.
There would be several possibilities.

1) Adapt namecoin to look into the bitcoin chain and allow atomic trades.
2) Create exchange chain and adapt namecoin to look inside exchange chain and allow contitional transactions
3) Create exchange chain and also create middle Coin that looks exchange chain and has contitional transactions.
4) Create exchange chain and middlecoin inside it.

For 2 and 4
https://forum.bitcoin.org/index.php?topic=31643.0

For 3
http://forum.bitcoin.org/index.php?topic=32258

What do you think about it?
Last edited by jtimon on Wed Aug 24, 2011 3:41 pm, edited 1 time in total.

jtimon
Posts: 27
Joined: Fri Jul 22, 2011 5:36 pm
os: linux

Re: trading nmc for btc in a completely distributed way

Post by jtimon »

A design for the protocol would be something like this:

message Bid {
required unsigned tradeId;
required float price;
required float maxAmount;
required Address exchangeCoinsTo;
required Address bitcoinsFrom;
optional unsigned exchangeCoinExpiryBlock;
optional unsigned bitcoinExpiryBlock;
}

message AcceptBid {
required unsigned tradeId;
required float amount;
required Address bitcoinsTo;
repeated required Input exchangeCoinPayment;
}

message Ask {
required unsigned tradeId;
required float price;
required float maxAmount;
repeated required Input exchangeCoinEscrow;
required Address bitcoinsTo;
optional unsigned exchangeCoinExpiryBlock;
optional unsigned bitcoinExpiryBlock;
}

message AcceptAsk {
required unsigned tradeId;
required float amount;
required Address bitcoinsFrom;
required Address exchangeCoinsTo;
}

The commit for the trade is always the bitcoin transaction. When it is done, the exchangeCoins are moved automatically by the exchangecoin network. That is, to know the balance of a given nmc address, the system has to take this messages and the bitcoin chain into account.
That could be applied to alternative currencies like namecoin too. This feature could be added to bitcoin or namecoin too. But a change in the protocol is needed every time you want to accept a new currency.

Accepted currencies can also be traded directly (not through exchangeCoins) for every other accepted currency if they extend their protocol with the following messages:

message FundTrade {
required unsigned exchangeCoinBlockNumber;
required unsigned tradeId;
repeated required Input otherCoinEscrow;
}

When AcceptBid or Ask messages are funded through an external accepted chain, instead of including the Inputs, it is necessary to indicate in what chain are those funds.
To save traders and external chains the task to watch all the accepted currencies chains looking for commits, the exchange chain miners must report all committed trades at the beginning of the block.

Namecoin could be exchangeCoin if it includes these messages.

jtimon
Posts: 27
Joined: Fri Jul 22, 2011 5:36 pm
os: linux

Re: trading nmc for btc in a completely distributed way

Post by jtimon »

It seems there's a better solution than my proposal that doesn't involves the creation of a new chain.

jtimon
Posts: 27
Joined: Fri Jul 22, 2011 5:36 pm
os: linux

Re: trading nmc for btc in a completely distributed way

Post by jtimon »


Post Reply