Author

Topic: [ANN] TxBits - an open-source Bitcoin exchange - developers and testers wanted (Read 3641 times)

hero member
Activity: 602
Merit: 501
Undeads.com - P2E Runner Game
why script if youre product if open source
and how i can create bitcoin exchange use youre service , can explain step by step
newbie
Activity: 16
Merit: 0
it's look like so cool!i wish your project can good develop!
member
Activity: 109
Merit: 10
I don't see any trading engine or even an outline, I hope you are not using scala for the trading engine, that should be written in C or C++ to be anything considered commercial grade.

You have no idea what you are on about if you think you NEED C++ for an exchange trading engine

A good Java/Scala programmer can produce something 10 faster than a poor C++ solution

At BEST you can expect a C++ solution to be 30% faster than a Java design from the same person (that is only because you have more influence on pipelining in C++), only the Java version can be developed 2-5x faster

Any highly optimal design will be SEVERAL ORDERS OF MAGNITUDE faster than SQL using modern techniques

But you are right in that using integer values can be significantly faster than float/double (which also have serious precision problems) and far far more efficient than BigDecimal

But its easy for us to heckle from the sidelines - well done on producing something Smiley
member
Activity: 109
Merit: 10
Why did development stall on this - its looks good so far, even if it is not mature

Are there obvious good contenders that are also open source ?
hero member
Activity: 602
Merit: 500
I saw there is an exchange called Crypto Trade which is powered by TxBits. Wondering if there's anyone maintaining the project.
newbie
Activity: 2
Merit: 0
I don't know scala too well, but being from java, I would say integer math on operations would be the best. Also how are you storing balances? Again I would say that should be in integer math. Their are any performance hits you take when doing integer math. It just means you should have a class for displaying it in a pretty string format (eg: 7.0533 BTC).

Balances are stored as numerics in PostgreSQL. They are read by the frontend with JDBC into Java BigDecimal objects, which we wrap into Scala BigDecimals. There is not much math done on BigDecimal objects as the majority of calculations happen in the database.

This will fail under heavy loads or volume. I would suggest having a trade matching aglo, hold every trade in redis, then dump that redis database into pgSQL once you have completed a trade. This would be the best way to handle that. Remember Mt. Gox was using php and mysql, which no better than yours, and that failed under heavy volumes.

There is a trade matching algorithm, I wrote it in PL/pgSQL. How would using Redis make this faster? Writing the data into Postgres after completing a trade would result in a disk access the same as using Postgres by itself. Postgres can cache indexes of tables in memory so lookups should be fast, especially with the use of sorted partial indexes. Additionally I have concerns with using something like Redis as it is not a transactional database and is not ACID compliant. With Postgres, I can be certain that orders will be matched based on the time inserted at a particular price and that a user can only place an order if there is sufficient funds on the account. The language you use does not mean as much as the algorithms you implement. I could write an exchange entirely in C++ but that does not mean my code will be efficient.

Very nice, I would say give details  (like how do you hash the password (Bcrypt, SHA 512)?)

Passwords are salted 8 iteration blowfish-based hashes and even the salted hashes are never visible to any of our servers except for the database where they are stored. It's easy to change the hashing algorithm if you would like. We wrote our own database functions to do 2FA as well. Unlike most exchanges that implement 2FA on their frontend, for example in PHP or Java, we implement it in SQL. This means that in order to place a withdrawal, your 2FA token must be passed to the withdraw function on the database. Withdrawals are processed by a separate server so in the unlikely event that the frontend web server is compromised, an attacker cannot issue withdrawals without your PIN. The frontend can only execute the stored procedures needed to do its job so it cannot execute arbitrary SQL queries or dump the database.
newbie
Activity: 2
Merit: 0
I see you are using bigdecimal, why are you not using integer math? I would use primitive objects like longs to do all math operations.

There are advantages and disadvantages in using integer math. We decided that the performance and size benefits did not outweigh the extra complexities and potential bugs with using integer values. O(n) operations will still be O(n), regardless of the object types.

I don't see any trading engine or even an outline, I hope you are not using scala for the trading engine, that should be written in C or C++ to be anything considered commercial grade.

Trading engine is in the SQL files. The trading engine is written in PL/pgSQL. The lookups are done using a cursor on the orders table. The orders table is indexed using sorted multi-column partial indexes so the engine may read the orders from the index without doing any sorting. This was verified with EXPLAIN ANALYZE in Postgres.

I haven't really looked into security, but I would treat this as a hobby project not a commercial grade anything.

Some details on security: https://github.com/txbits/txbits/wiki/Security

Can anyone help me install this to my server?

Use the wiki for instructions on setting up a development environment. Wait for a stable release before deploying it to a server.
newbie
Activity: 44
Merit: 0
Can anyone help me install this to my server?
newbie
Activity: 44
Merit: 0
Working nicely for me. I like it Smiley.
Were you able to donwload the script and install it to your server? If so, can you help me install it to mine?
legendary
Activity: 1498
Merit: 1000
How do you know what commercial grade exchanges are? What work experience have you working with commercial grade exchanges?

I see you are using bigdecimal, why are you not using integer math? I would use primitive objects like longs to do all math operations.

I don't see any trading engine or even an outline, I hope you are not using scala for the trading engine, that should be written in C or C++ to be anything considered commercial grade.

I haven't really looked into security, but I would treat this as a hobby project not a commercial grade anything.
legendary
Activity: 1610
Merit: 1000
Well hello there!
Just forked a copy of source off GitHub.  Gotta love the pioneering spirit of the open-source community.
legendary
Activity: 1512
Merit: 1000
Working nicely for me. I like it Smiley.
sr. member
Activity: 338
Merit: 250
interesting. I will be watching this thread.
sr. member
Activity: 258
Merit: 250
i just want to say that you guys are great! amazing great.
open source is changing the world. code is changing the world.

just openend a test account.
newbie
Activity: 3
Merit: 0
I didn't know you can do that. That's a good idea. For now our CPU is at 3-5% with everything running on the same server, but once we have to handle more traffic, I'll try that.
hero member
Activity: 924
Merit: 511
You can pre-compress all the static files (HTML, PNG, CSS ect...) into {filename}.{filetype}.gz and then have Nginx automatically fetch and return the .gz files for the static content. This can save you CPU and bandwidth (also make your site super SUPER fast)

http://wiki.linuxwall.info/doku.php/en:ressources:dossiers:nginx:nginx_performance_tuning <-- I think you should include that on your github for Nginx Smiley

newbie
Activity: 3
Merit: 0
sr. member
Activity: 322
Merit: 250
Sound Engineer for Hire
Sure I wanna help test Smiley

EDIT: Seems to be working just fine.
looking great for an open source coin exchange Smiley good job!

EDIT #2: I think you should make the homepage of TXBits show a different display once you're already logged in since it asks for a user and pass in the front page, though you can always go back to the dashboard in the header, it's much better for the sake of professionalism
newbie
Activity: 3
Merit: 0
I am announcing the release of the source code to our new open-source Bitcoin exchange. We invite developers and testers to get involved with the project.

Project site: https://txbits.org
Source code: https://github.com/txbits/txbits
Try our beta on the testnet: https://testnet.txbits.com
Jump to: