Author

Topic: Bugs/Fixes to the BitShares BlockChain Rules (Read 973 times)

hero member
Activity: 770
Merit: 566
fractally
The source of our problems is establishing the minting rate... right now it is entirely one sided with no market forces to push it to the proper rate.  This occurs because the exchange was based upon trading existing crypto-Gold for BS and attempting to 'tack' minting onto an entirely un-related exchange.   So, here is my new strategy for controlling mint rates:

1) It is entirely pointless to have an exchange between BS and crypto-Gold because we know the exchange rate 'exactly' based upon the dividends... thus my old exchange was 'pointless'.
2) What we really want is an exchange between 'minting' and 'melting', thus when you melt you reverse the process of minting by turning crypto-Gold into BS at some 'rate'.   

So instead you turn the market into an 'mint' vs 'melt' market...
    - when I melt...  I want the highest possible ratio that allows me to buy the most gold.
    - when I mint.... I want the lowest possible ratio that allows me to sell the crypto-Gold for gold.
    - the two market participants must agree to the mint/melt price.
   
* note * the minter is no longer given an option to cover at his mint price, thus there is no longer a 'short' position to be covered.

So how would this work?
     - Initially there is no crypto-Gold... thus, you can mint at any price you want you are creating a new currency
     - This creates new crypto-Gold which the holder does not want to melt for some time.
     - When there are no melters, you can only 'mint' at the same or higher ratio (no debasing)
     - Once there is an offer to melt, that is the highest (and lowest) you can mint at (melter/minter just exchange).
     - When there are no minters, just melters, then you can melt at the current rate.

Why would someone mint in the first place?
     - to create a new peg and establish a new crypto-Gold.  Those who have crypto-Gold know they paid 1 gold coin for it, and it was at parity, they are not going to take a loss if they can help it.
     - If the value of gold goes up it requires more BS to back it, thus you can always mint at a new higher rate.
     - If the value of gold goes down, then crypto-Gold will be 'over-backed'.  No one will want to 'mint' at the old backing... and any crypto-Gold holders will not be able to 'melt' over the mint price,
          both parties realize that the only price they can 'agree on' is the current market price of gold.   This would allow 'one in' and 'one out' of the crypto-gold market.

Why would someone melt from a high-yield (over-backed) crypto-Gold balance into BS?   
     After all they could just trade their crypto-Gold balance at full value without melting!  No one will melt unless they are forced to melt and thus we need to find a way to force melting.  I think the way you do that is to only allow transfer between addresses while in BS form.  Thus, you can only transfer value through BS, but you can store it as crypto-Gold.   

If we ignore the technical challenge of turning every gold wire-transfer into two market orders... this approach should work.

So, how would eGold operate? 
    - initially they would Mint as much crypto-Gold as they could sell for gold with a fee.... thus they have acquired a lot of gold.
    - if the price of gold goes up... egold would sell some of their gold for BS and offer to mint for anyone willing to melt.. there would be a spread (egolds profit)
    - if the price of gold goes down... the crypto-gold would now be backed by too much BS... so the holders are earning a lot of interest... this causes a rush into
      the crypto-gold market with everyone wanting to 'mint'... but they could only mint at the lowest melt price.. this forces them to mint high and for the melter to melt low so
they can agree on a price... thus parity will be established with supply and demand.
hero member
Activity: 770
Merit: 566
fractally
I have been doing some very heavy thinking recently and have concluded that what I have here is NOT crypto-USD or crypto-Gold  I have simply created a market for shorts / longs which can then 'hedge' by placing opposite bets.

Imagine you have 10 bitcoins, you think they will go up against $USD so you mortgage your bitcoins to create  mBS to create crypto-Q where the exchange rate is 1:1

Someone else believes that bitcoins will go down relative to dollars they buy crypto-Q.

If the value of BitCoins goes UP       - then the person mortgaged them will be able to buy them back cheaper than they sold it and thus profit.
If the value of BitCoins goes Down  - then the person who mortgaged them will not be able to repurchase crypto-Q except at a higher price than they sold it.

In effect, crypto-Q is just the opposite end of a short position. 

So now take someone who has $USD and they want to buy into Bitcoin but don't want the risk of Bitcoin falling and as a result losing their value.   They can offer to buy
crypto-Q at a discount to full up Bitcoin.   Lets take an extreme example, they could buy crypto-Q for 50% of the bitcoin price. 

The individual who went 'short' wins because they get to get cash now and recover their Bitcoins in the future.
The individual who purchased crypto-Q wins because they have some margin, if bitcoin goes down they can still sell at a profit.

These are the building blocks that we have to work with.   I believe what I created was a market for one-way USD where the losers in that market were those who went short (withdrew USD).    Therefore, you could deposit USD and never have to worry about it going back down.   The only side effect is that when prices go the other way a new currency ie: crypto-Oil-2 must be issued as a new 'base' for one-way movement.

I will have to figure out how to get the price to auto-correct in the other direction or BitShares will not work as I had originally envisioned, BUT I still believe that it is worth investing into because it offers great hedging / leveraging potential without counter-party-risk.   

As a result of this new understanding I am temporarily suspending the bounty to find bugs until I can figure out what I have here.


hero member
Activity: 770
Merit: 566
fractally
The only thing that increasing the minimum bid size does is increase the capital the attacker would require and introduce an 'arbitrary' number into my system. 

Instead, I think that a minimum 'issue' size that is allowed to consume all of the highest bids until the issue size is 'filled'.   

Therefore, you can always issue 1 BS worth of ANYTHING using the top 1 BS worth of bids.   To maintain a peg, eGold would have to maintain at least 1 BS worth of bids at market price.  The attacker would then be left with nothing to gain because he would have to fill bids with his stash which would quickly be gone.

I think this is a simpler and more flexible rule, hopefully it doesn't have unintentional side effects... I am sure TheZerg will find them... updating the rules now.
hero member
Activity: 770
Merit: 566
fractally
Reposting my response to keep it in-line:

Just because it goes up due to momentary scarsity does not mean you broke the peg (remember my +/- 10% trading range).
The margin between crytpo-Oil and oil is what provide profit motives for people to bring goods into/out of crypto-Oil based upon supply and demand.

So all you did is partially fill one order ABOVE MARKET VALUE.  Because there exists bids above market value we can assume the following:

0)  While eOil has crypto-Oil they will sell at a profit.
1)  eOil will not buy nor issue ( you stopped nothing they wouldn't have done anyway )
2)  Everyone else has profit motive to sell and bring the price down.
3)  You have opportunity cost by not selling the full amount.

So the only way you can claim that you are a rational, profit-seeking, actor is if you have some way to profit from this which is greater than the opportunity cost.


NOTE:  Those who purchase crypto-Oil have only one requirment:  its value shall not fall below parity by more than a couple of percent.  Therefore, breaking the peg to
the up side actually means they profit.  You cannot hurt someone who owns crypto-Oil by pushing the price above parity and keeping it there.  You would be losing money
every day you held the peg due to transaction costs. 


So, lets look at what it would take to ACTUALLY pull off this attack:

a) you would need to purchase crypto-Oil above market rates and hold it at opportunity cost.
b) you could drive everyone to sell their crypto-Oil for BS at a profit as the value of oil falls.
c) you would discourage / prevent new people from trading their oil for crypto-Oil.
d) you would cause eGold to issue crypto-Oil 2 which was cheaper than crypto-Oil yet also would never fall below parity.
e) everyone with crypto-Oil would trade into crypto-Oil 2 at a profit.
f) market will continue as normal with no one taking any losses except the attacker.
g) the attacker would then have to sell crytpo-Oil at a potential loss, and then start buying crypto-Oil 2 above market rates...
h) eventually the attacker will be bankrupt while everyone else is receiving higher dividends thanks to all of the transaction fees
   the attacker is racking up to no real effect.


So you have failed to put eOil out of business or steal any money from anyone.  You did succeed in disrupting the market, forcing it over to another crypto-Oil 2 which would cause ineffeciencies and confusion.
Your attack would only work once you had cleared out all other sellers, and thus would be very innefective in any large market like gold, usd, etc.

Your attack takes advantage of the fact that you can issue 'dust' orders.
Your attack is not profitable, and is more along the lines of DOS.
Your attack would not be possible if you could not place 'dust' orders because you would run out of capital too quickly by filling orders above market rate.
Therefore, you would need rules like bitcoin has to prevent 'dust' transactions from propagating or being included.


Therefore if we had the following rules:

You can issue against multiple bids at once provided they are at the same price.
All bids must be a multiple of 2x the minimum transaction fee. This forces grouping of bids in the same 'range' to be the same effective price.
Define a minimum 'order amount' to prevent dust orders... this order amount could be defined by 'miners' and therefore subject to 'market forces'.

The block chain is clearly not an effecient datastructure for micro or high-speed transactions, so lets assume that there are a number of
'spam filters' that the clients could run to detect this kind of DOS attack.

Given that assumption we can conclude that when it comes to 'trading' the blockchain will only be used by those who can trade in multiples of $100 and anyone
wanting to trade in smaller lots would have to do so 'off chain' on a Open Transactions server.


Does your attack work if you don't have access to dust?


Considering you failed to drive eGold out of business or steal money from anyone *and* your attacker was not motivated by profit and took constant losses, technically I don't think you should win the 0.25 bounty.

That said, this was a good attack and provoked thought and rule changes so I will award you 0.25 because it was still valuable (and found prior to upping the bounty).

PAID 0.25 BTC
legendary
Activity: 1246
Merit: 1010
I am so on my edge to find bugs before Zerg that I am making up non-existant bugs!

Lol :-) seems like an effective bounty then because you are starting to think like an attacker.  Reposting my attack here:

Ok, suppose I am a major holder of crypto-oil.  And suppose crypto-oil's demand is high because it has tremendous utility. 

Normal case:
Essentially, people are giving eOil (and others) money or oil contracts and eOil is giving them crypto-oil.  Eventually, eOil is going to run out of crypto-oil and will have to buy at market.  If nobody is willling to sell at that price, eOil's bid is minted so crypto-oil remains pegged to oil.  This makes sense because eOil's backing increased.

Attack:
So during every block I fill the minimum crypto-oil denomination, stopping the minting process.  Now the only way eOil is going to get crypto-oil currency is by bidding high enough to encourage existing holders (me primarily, but other holders can of course profit from my action) to sell their shares.  I have decoupled crypto-oil from oil and once eOil bids high enough I'll sell my crypto-oil to them at great profit (5 to 10% for a few days work), buying it back at a lower price when crypto-oil re-couples to oil.

If eOil refuses to buy my high sell offer, they cannot acquire crypto-oil and so must stop doing business.



hero member
Activity: 770
Merit: 566
fractally
I'm an idiot... anyone who places a bid so high would immediately find a current holder of crypto-Gold willing to sell at insane profit and then clear out the bid.  This wouldn't slow down issuance at all.

I am so on my edge to find bugs before Zerg that I am making up non-existant bugs!
hero member
Activity: 770
Merit: 566
fractally
I could modify the rules to allow issuance against up to 25% of active bids, provided they are the top 25% of the bids. 
No one would be able to afford to do the over-priced attack with any significant value/quantity.............

Actually, they could propose to buy .0000000001 crypto-Gold for 10BS and that would force someone to issue at that rate... and they would never be able to back-out of that position....

Back-to the drawing board on fixes...
hero member
Activity: 770
Merit: 566
fractally
I have just discovered a new avenue of attack.... working on a fix (0.25 bounty) offered to someone who can propose a fix that I find acceptable.

Given the rules, I could prevent the anonymous peg from re-issuing at a higher price by placing a bid buy a 1 satashi of crypto-Gold for a VERY high price.  This would effectively prevent all new issuance and cost me next to nothing.

Without new issuance, the price of crypto-Gold would diverge to the UP SIDE from actual gold.

hero member
Activity: 770
Merit: 566
fractally
Attacks that I find do not collect bounty...:

Assuming I have 50% of the hashing power... what can I do?
  I can delay all transactions...
  I can delay potential bids from being placed into the chain...
  I can pick winners / losers for matching bids... half of the time.
 
  The market response:  increase bid/ask spread to account for the delays.
  Attacker benefits:   they could have better arbitrage opportunities.
  Trader Response:   add more hashing power so you can gain the advantage.
 Net Result:  Arms race among professional traders to add hashing power to gain an advantage... thus making 50% attack even harder.

Assuming there is someone out there attempting to peg crypto-Gold to gold.. how can I screw them up?
  1) To issue new crypto-gold I would have to out-bid them, thus pushing the value of crypto-gold up... no real complaints from the holders and selling opportunity for the peg who would profit from it.  In theory there is no limit to how *high* I could push crypto-gold above the gold price.   The peg would make a ton of money from the extra dividends he was receiving from the attackers over-priced issuance.   The attacker wouldn't be able to redeem their 'short positions' for a profit and thus face an ongoing opportunity cost until they admit their losses.  

  2) To cause the value of crypto-gold to fall below parity they would have to sell crypto-gold.  To sell crypto-gold they must first acquire it and the only way to acquire it is to mint above market price or have bought it from the peg.  If they bought from the peg, then they paid 1% above market price.   I suppose the peg would have to 'buy' at market price or it would give the attacker an opportunity to mint below market price.   * I will have to change the business plan of the peg * as a result... this doesn't change the rules of the block-chain though.  
hero member
Activity: 770
Merit: 566
fractally
I will use this thread to publish the design and discuss it.  Ideas are welcome.

BitShare User Interface:
-----------------------------

Because BitShares and the resultant sub-currencies are based upon variations in dividend revenue streams, it can be very hard for the average grandma to understand what is going on and what something is actually 'worth'.   After all, to determine the actual price of crypto-Gold relative to BitShares requires dividing two constantly changing dividend rates.  Therefore, the user interface will require the following tweaks:


1) It will display the current dividend rate on BitShares so the users can see.
2) It will display the sub-currencies price as multiples of a BitShare calculated by dividing the sub-currency dividend rate by the BitShare dividend rate.  Thus all sub-currencies are 'priced' in terms of BitShares.
3) It will allow the user to specify an exchange rate between BitShares and any other real-world-good and the parallel crypto-Currency and then update all pricing in terms of that arbitrary good.
4) It will then allow the user to specify an exchange 'ticker' to subscribe to.

The end result is that the user of BitShares will be able to see all crypto-sub-currencies priced in their 'native' currency based upon any exchange.

At this point it would be very easy for the user to identify which sub-currencies are over/under-priced relative to one another and trade between them without having to worry about the mechanics of relative revenue streams.














hero member
Activity: 770
Merit: 566
fractally
**  deleted **
Jump to: