Bitcoin Forum

Bitcoin => Project Development => Topic started by: IamAGentleman on December 07, 2014, 09:44:03 PM



Title: Building an opensource exchange from scratch
Post by: IamAGentleman on December 07, 2014, 09:44:03 PM
I am building an opensource Crypto currency exchange from scratch and will release the source code on here. Will take me a couple of months it'll be OOP, and using twitter bootstrap. I will release to the public once it's complete, keep an eye out. I've only just started. Register page is pretty much the same layout as cryptsy. Site will be run based on classes and functions MVC.  All userinputs will be trimmed, escaped and secured  to stop any sql injections. WIll also need people eventually to test for XSS and other types of flaws.

For an example, the $_POST will be passed through $system->secureinput(); function.
Dashboard coins will be accessed via a htaccess rewrite: website.com/dashboard/market/coin
Not too sure what coins I will be adding, but BTC, LTC and a few others are a must. Will eventually be adding a language file that can be edited via the admin panel

Features built:

- User register
- User Login
- Navbar
- Sidebar
- Dashboard
- Profile
- Language file added with an option for users to select language...
- Added a timeline to show you all of your purchases.
- Bitcoins can now be deposited and balance updates.



To DO:

- Get callback from OKpay for deposits of GBP and USD
- Allow bitcoin withdrawals
- Add LITC deposit,withdraw
- Create a nice index page
- Clean up a few things and it will be done


Pictures:

https://i.imgur.com/EQZtYmK.png
https://i.imgur.com/y3SJo1u.png
https://i.imgur.com/5Lgdekm.png
https://i.imgur.com/y4Uflt9.png
https://i.imgur.com/oVCFpCJ.png
https://i.imgur.com/SnCkdGn.png
https://i.imgur.com/PK3gdWH.png
https://i.imgur.com/tHyhMog.png
https://i.imgur.com/aMchU3d.png


Title: Re: Building an exchange from scratch
Post by: hexafraction on December 07, 2014, 11:44:02 PM
Looks very nice; will it integrate with all of the bitcoin-clones out there over RPC? What about unique coins (maybe over some sort of PHP-class that could be loaded for each distinct coin)? Maybe even some sort of integration with a bank/ACH API?


Title: Re: Building an exchange from scratch
Post by: IamAGentleman on December 08, 2014, 12:47:53 AM
r
Looks very nice; will it integrate with all of the bitcoin-clones out there over RPC? What about unique coins (maybe over some sort of PHP-class that could be loaded for each distinct coin)? Maybe even some sort of integration with a bank/ACH API?

Yeah, coins using the same source as Bitcoin and Litecoin should be pretty easy to implement.  Regarding a bank, I probably will in the future, but I'm not too sure of what ones to add, but I will add paypal depositing money and withdrawing.


Title: Re: Building an exchange from scratch
Post by: IamAGentleman on December 08, 2014, 02:03:28 AM
Added more functions


Title: Re: Building an exchange from scratch
Post by: IamAGentleman on December 08, 2014, 03:06:29 AM
Trade history is now working. Will start cleaning up a few things and start working on the Bitcoin api to generate a wallet to deposit bitcoins.


Title: Re: Building an exchange from scratch
Post by: meowball on December 08, 2014, 04:45:49 AM
Nice project. Sounds like you'll be very busy for a while!  ;) If it's open-source, when do you plan to show the repo? I could maybe contribute here and there when I have time. I'm pretty busy myself.


Title: Re: Building an exchange from scratch
Post by: IamAGentleman on December 08, 2014, 05:13:36 AM
Nice project. Sounds like you'll be very busy for a while!  ;) If it's open-source, when do you plan to show the repo? I could maybe contribute here and there when I have time. I'm pretty busy myself.


Thank you. The base of is coming a long very well. All I need to do is implement the bitcoin and litecoin api to create a wallet, check deposits etc, the website is pretty much trading now, I've just edited the credits via the phpmyadmin. I'd say a month and the repo will be released, hopefully that will include a fully functioning admin panel too. I don't want to release it while it's buggy, so I'll spend a certain amount of time testing every features. Hopefully this becomes something, I just hope to god it doesn't attract people who will just run it hoping for a quick buck.


Title: Re: Building an exchange from scratch
Post by: IamAGentleman on December 08, 2014, 05:23:21 AM
Also, if anyone can create a Bitcoin and litecoin ticker, I'm currently using Blockchain, and when I release it that wont be included because it's bad practise, I'll grab maybe 5 tickers, round up the numbers and the average of that will be the price... I guess. I'm not too sure how I'll work that, any tips will be appreciated


Title: Re: Building an exchange from scratch
Post by: Small on December 08, 2014, 05:28:50 AM
I like the clean design!
If you need any help with testing or debugs or anything like marketing or management,
I'm glad to help out.


Title: Re: Building an exchange from scratch
Post by: dezoel on December 08, 2014, 12:15:59 PM
clean design!

I hope more than just exchange system, and one more, please add more language because most users in my country can't use english perfectly.
I think this can be diferent with another exchange sites :D

*just my opinion


Title: Re: Building an exchange from scratch
Post by: IamAGentleman on December 08, 2014, 01:24:23 PM
clean design!

I hope more than just exchange system, and one more, please add more language because most users in my country can't use english perfectly.
I think this can be diferent with another exchange sites :D

*just my opinion

Added a language option, but it will need translating, Once it's released we can all translate it.


Title: Re: Building an exchange from scratch
Post by: IamAGentleman on December 08, 2014, 02:46:16 PM
Help translate guys, I'll adding more so keep an eye out for this updated post

Code:
<?php

$lang 
= array();

//dashboard
$lang['buycoin'] = "Buy";
$lang['sellcoin'] = "Sell";
$lang['ammountof'] = "Ammount of";
$lang['valueof'] = " Value of";
$lang['totalpriceof'] = "Total Price of";
$lang['buyingorders'] = " Buying Orders";
$lang['sellingorders'] = "Selling Orders";
$lang['calculatetotal'] = "Calculate Total";

$lang['tostitle'] = "Terms of Service";

//register page
$lang['registertitle'] = "Register Form";
$lang['firstname'] = "First Name"
$lang['lastname'] = "Last Name"
$lang['username'] = "Username"
$lang['email'] = "Email"
$lang['password'] = "Password"
$lang['passwordconfirm'] = "Confirm Password"
$lang['passwordrequirements'] = "Password Requirements";
$lang['passwordchars']= "8 characters minimum";
$lang['passworduper'] = "1 or more upper-case letters";
$lang['passwolower'] = "1 or more lower-case letters";
$lang['passwordspecial'] = "1 or more digits or special characters";
$lang['registersecurity'] = "
These security questions will not be changeable or visible after registration. <br/>
If you lose access to your email/account, we will use these questions as part of the process to grant access to your account."
;
//faq page

//Faq 1
$lang['faq1question'] = 'I\'ve never heard of Bitcoins, what exactly are they?'
$lang['faq1answer'] = "
Developed in 2009, Bitcoin (frequently referred to as BTC) is a digital form of currency, 
revolutionizing the world by becoming the first online currency able to be traded between individuals without a 
\"middle man.\" This means that users of the Bitcoin system are able to trade Bitcoins with one another without 
going through a payment processor such as a bank, allowing you the freedom to buy, sell and trade as you please. 
For a lot more information check How it works or the official Bitcoin site Bitcoin ."


//Faq 2
$lang['faq2question'] = 'Is trading bitcoins and the usage of website legal?';
$lang['faq2answer'] = "
btc is a deposit collector for real money and virtual currency bitcoins (BTC), so yes. 
Trading and having an account with btc.com is legal. It is your personal responsibility to 
declare any profit, accumulated by trading with BTC through btc"


//Faq 3
$lang['faq3question'] = 'Is my information/identity safe when using Bitcoin?';
$lang['faq3answer'] = "
Yes! Using a system established upon obscurity and encoding, Bitcoin is extremely secure. btc will not dispense,
 broadcast, nor vend your information to any parties. It should be noted though, that if and when it is requested 
 by government agencies that . btc disclose information relating to user activity and/or contact information we 
 will comply. Since your personal Bitcoins are maintained on your computer, it is imperative that you take 
 additional steps to ensure that your Bitcoin wallet remains protected from users other than yourself. You 
 should take the necessary precautions to keep your own Bitcoin wallet (on your computer) safe from third 
 party access."


//Faq 4
$lang['faq4question'] = 'How do I get started?';
$lang['faq4answer'] = "
Simply sign up for an account on the btc website- don't worry, it is absolutely free! 
Once you have created your account you need to place funds into the account using an approved 
means of deposit. You are now ready to begin purchasing and selling Bitcoins on the btc website. 
btc trade system will always match your offer with the optimal benefit for you."




?>


Title: Re: Building an exchange from scratch
Post by: IamAGentleman on December 08, 2014, 11:00:26 PM
More Features, give me feedback.


Title: Re: Building an exchange from scratch
Post by: meowball on December 08, 2014, 11:45:55 PM
oh nooo. php!  :) Why not use javascript? hehe


Title: Re: Building an exchange from scratch
Post by: IamAGentleman on December 09, 2014, 12:01:37 AM
oh nooo. php!  :) Why not use javascript? hehe

Lol what do you think.


Title: Re: Building an exchange from scratch
Post by: IamAGentleman on December 09, 2014, 06:33:28 PM
Bitcoins can now be deposited.


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 10, 2014, 12:33:53 AM
Calculate fees done.


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 10, 2014, 03:38:11 PM
We can now trade coins guys. Big step forward.


Title: Re: Building an opensource exchange from scratch
Post by: Bitcoin Explorer on December 10, 2014, 04:16:39 PM
I'm more of a design guy (front end)  and I must say. The design is awesome


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 10, 2014, 04:24:43 PM
I'm more of a design guy (front end)  and I must say. The design is awesome


Thanks brother :)


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 10, 2014, 11:27:16 PM
Guys, I will e uploading a demo site of it soon so it can be tested it's not finished, but want to see if there's any bugs/glitches/hacks


Title: Re: Building an opensource exchange from scratch
Post by: dallyshalla on December 11, 2014, 01:12:08 AM
Sweet projects you have going here Gentleman,

Does this exchange project allow me to directly import my private key to use my coins without trusting any deposit?


Sincerely,
Dallyshalla


Title: Re: Building an opensource exchange from scratch
Post by: Bitcoin Explorer on December 11, 2014, 01:29:56 AM
I'm more of a design guy (front end)  and I must say. The design is awesome


Thanks brother :)
never mind, great to see some amazing open source work going on in the bitcoin ecosystem, if you need help with css, html or any design, please let me know, ill be more than happy to help you


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 11, 2014, 02:22:15 AM
Sweet projects you have going here Gentleman,

Does this exchange project allow me to directly import my private key to use my coins without trusting any deposit?


Sincerely,
Dallyshalla
I'm not too sure how I'll implement that, can you give me a website that is using that feature?


Title: Re: Building an opensource exchange from scratch
Post by: PotatoPie on December 11, 2014, 05:16:30 AM
PM me when you have it done and I'll look through the code for any possible security flaws.


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 12, 2014, 05:12:45 AM
Added gzip to header so the html is now compressed load times are faster.


Title: Re: Building an opensource exchange from scratch
Post by: jokerboy on December 12, 2014, 05:23:55 AM
Nice work, do you have a github account ?


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 13, 2014, 01:57:40 PM
Not yet, but near project release I'll get one :)


Also guys added gettext for translations.


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 13, 2014, 04:04:13 PM
Added to MVC. Can make things easier for developers to access certain stuff for an example:

User information:

Code:
<?php
$user
->btc_balance //this would pull the users bitcoin balance
$user->username //this is the users username
$user->ltc_balance //this is the users litecoin balance
?>

etc...

And we can add text for peoedit for translations like so:
Code:
<?php
echo _ex("Tex you want trasnlating");
?>


It's coming along quite well. Keep checking back.


Title: Re: Building an opensource exchange from scratch
Post by: mudiko on December 13, 2014, 04:33:35 PM
looks cool and interesting. i wish it will work fine when u will publish it


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 13, 2014, 07:37:43 PM
looks cool and interesting. i wish it will work fine when u will publish it

It will do, will do a beta test for people to find bugs, I can patch them and then release the script.


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 13, 2014, 11:54:48 PM
Charts added to show a graphs of old trades from prices and times.


Title: Re: Building an opensource exchange from scratch
Post by: jokerboy on December 14, 2014, 12:15:11 AM
When do you plan to release ?


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 14, 2014, 01:35:46 AM
When do you plan to release ?

Not too sure. Need to complete it first then have people test for exploits and then bugs, then the script can be released. Don't want to release it too early and then people use it and get hacked.


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 14, 2014, 03:13:35 AM
Are you going to release on git unbroken? Seems a lot of open source for exchange platforms are all broken and don't function how they should  and it going to remain free?

Yep, will release a full working repo... it's working now but adding more things and securing some stuff.


Title: Re: Building an opensource exchange from scratch
Post by: jeffersonairplane on December 14, 2014, 05:00:14 AM
open source is what caught my attention. Everything looks pretty good  :)



Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 15, 2014, 06:30:22 AM
Need feedback features I can add? I've added a wysiwyg to add userguides....


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 15, 2014, 06:45:55 AM
https://i.imgur.com/kZ7bXKl.jpg


Title: Re: Building an opensource exchange from scratch
Post by: ed_teech on December 15, 2014, 06:58:55 AM
Interesting.

How many trades/second can you handle ?


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 15, 2014, 07:11:29 AM
Interesting.

How many trades/second can you handle ?

Not sure. I really couldn't say unfortunately, but the script load times fast so I guess it will depend on people's servers.


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 15, 2014, 07:14:38 AM
SMS verify and document verification as well as google auth basically google auth OR SMS 2FA if anything

The document verification is what I am working on next :) I'll take a look at google auth and implement that too. Regarding SMS verify, I was looking at that, I will definitely add it as long as people know they need a gateway to use it and I think most are pay ones?


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 15, 2014, 07:32:41 AM
https://i.imgur.com/LMHqUGn.png


Title: Re: Building an opensource exchange from scratch
Post by: ed_teech on December 15, 2014, 07:38:31 AM
Interesting.

How many trades/second can you handle ?

Not sure. I really couldn't say unfortunately, but the script load times fast so I guess it will depend on people's servers.

I guess tuning the engine to handle large number of simultaneous trades is the hard part. I suggest doing a load test before going live.


Title: Re: Building an opensource exchange from scratch
Post by: Bitcoin Explorer on December 15, 2014, 01:40:53 PM
So far this has been really good. I've been having a look every day on the thread for at least once, it is really nice and the progress is drastic. Great job man.


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 15, 2014, 04:00:43 PM
So far this has been really good. I've been having a look every day on the thread for at least once, it is really nice and the progress is drastic. Great job man.

Thanks bud :)




This shows up on dashboard page and withdraw page, once we accept accept via admin panel the user can start trading...

https://i.imgur.com/ZDRZsSN.png


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 15, 2014, 05:23:33 PM
Added login information for security. show users who have logged in or tried logging in to their account. May add an algorithm to ban ip addresses for a certain amount of failed logs in with different emails.

So ip: 000:000:00:00 has tried to login to: email addresses and has failed *number of times* ban user.


Title: Re: Building an opensource exchange from scratch
Post by: jokerboy on December 15, 2014, 05:23:58 PM
When do you plan to release ?


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 15, 2014, 05:51:41 PM
When do you plan to release ?

If everything goes to schedule new year.


Title: Re: Building an opensource exchange from scratch
Post by: jokerboy on December 15, 2014, 06:04:11 PM
When do you plan to release ?

If everything goes to schedule new year.
I am waiting impatiently :)


Title: Re: Building an opensource exchange from scratch
Post by: jokerboy on December 15, 2014, 06:27:29 PM
Also can you add google 2-step verification ? and single SMS verification ?


Title: Re: Building an opensource exchange from scratch
Post by: Zilara on December 15, 2014, 08:15:38 PM
Calculate fees done.


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 15, 2014, 08:35:48 PM
Calculate fees done.

Huh? lol


Title: Re: Building an opensource exchange from scratch
Post by: ed_teech on December 16, 2014, 09:43:36 AM
If you need any helps during the development I can help you.


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 17, 2014, 12:00:53 AM
Won't be working on this project for a week or two. After that hopefully I can get back to it.


Title: Re: Building an opensource exchange from scratch
Post by: walterVC on December 17, 2014, 12:29:09 AM
Cool thing.
Whould it be possible for you to share the source code via github?
You could do it while the project is in progress.


Title: Re: Building an opensource exchange from scratch
Post by: NarC on December 17, 2014, 04:18:29 AM
Really like the design, even if it is just a $15 themeforest theme


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 17, 2014, 04:35:24 PM
help back this project for any amount. Remember I am not selling this so any contributions would be hugely appreciated. https://www.startjoin.com/backers/project/cryptoexchange1


Title: Re: Building an opensource exchange from scratch
Post by: daybyter on December 17, 2014, 08:35:01 PM
How do you handle to wallet installation to accept various coin types?


Title: Re: Building an opensource exchange from scratch
Post by: Alex_crypto on December 19, 2014, 02:33:10 AM
very noble project. Good luck with it.


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 29, 2014, 09:54:27 PM
It's not really been getting much publicity :(


Title: Re: Building an opensource exchange from scratch
Post by: Small on December 30, 2014, 01:20:04 AM
It's not really been getting much publicity :(

I like it very much!
To the developer(s): Don't give up, we've got you!


Title: Re: Building an opensource exchange from scratch
Post by: jokerboy on December 31, 2014, 03:24:35 PM
Are you using github for this project ?


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 31, 2014, 06:56:50 PM
Are you using github for this project ?

yes.


Title: Re: Building an opensource exchange from scratch
Post by: jokerboy on December 31, 2014, 07:38:35 PM
Are you using github for this project ?

yes.
Can you share your depository with us ?


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 31, 2014, 07:45:35 PM
Are you using github for this project ?

yes.
Can you share your depository with us ?

It's no good releasing it yet as mentioned earlier because it will have people publishing it straight away without it being fully functioning and then getting hacked. 


Title: Re: Building an opensource exchange from scratch
Post by: Crestington on December 31, 2014, 08:01:37 PM
Ooohhh, LIKE!

How did I miss this? definitely following this


Title: Re: Building an opensource exchange from scratch
Post by: jokerboy on December 31, 2014, 08:08:37 PM
Are you using github for this project ?

yes.
Can you share your depository with us ?

It's no good releasing it yet as mentioned earlier because it will have people publishing it straight away without it being fully functioning and then getting hacked. 
I see but maybe some other developers can contribute to your project and it will be easier for you too.


Title: Re: Building an opensource exchange from scratch
Post by: hexafraction on December 31, 2014, 08:58:35 PM


It's no good releasing it yet as mentioned earlier because it will have people publishing it straight away without it being fully functioning and then getting hacked. 

Including a mandatory configuration option and/or visible banner that the software is in development, and that the user acknowledges all risk, could alleviate this issue.


Title: Re: Building an opensource exchange from scratch
Post by: IamAGentleman on December 31, 2014, 09:14:26 PM
https://github.com/NateCorkish/exchange

Need to fix a lot. Lot's of double coding that I can fix etc.
Remember I have only been working on it for a week and a half - 2 weeks.