1

As in exchanges, They provide their users only deposit address but not private keys and our all funds exists under main exchange account.

How is it possible to setup ethereum in our own server?

Where all deposit to any address comes under main account and each address can view their balance only.

  • I suppose the exchange runs their own Ethereum node, and all the accounts you create through their website are created on this node. So, they keep private/public key of your account. Ethereum info is public, so you can vew the balance of other people too, if you knew their address. – Nulik Mar 20 '18 at 13:45
0

Not like bitcoin, at all!

Ethereum isn't like bitcoin where you can combine inputs and all funds at an address go into a transaction, with multiple outputs.

With Ethereum, all addresses are their own wallets and have their own funds, and when you spend, you only send what you need.

Creating addresses for users

If you want to allow users to deposit to their own address, then you can simply create a new address for them.

You don't need to give the users control of their private keys, however there is no combined pool of funds. Ethereum won't magically work out how to combine addresses as inputs to make the required balance for you.

Another, better way...

When you move to Ethereum, you need to start thinking in a different way.

  • Ethereum is about tokens and contracts.
  • Ethereum is about putting your server logic into the blockchain.

With Ethereum, people transfer funds to your contract, and your contract records the payment, usually (but not necessarily) by giving them a virtual token.

Then people who hold tokens (or other interest or control) can call your contract and ask to perform actions, or direct it to transfer control or tokens to other addresses.

They don't send you funds and get nothing. They send you funds and get a promise and control of something equivalent in value, or a tangible or physical item.

Onsite integration into your website

What's more, you can even integrate the blockchain into your website. This technology is called Web3 (as opposed to Web 2.0).

It means that customers can view their balances of your tokens on your website, and authorise actions against those funds using their wallet(+private key) from their browser.

An example of a physical purchase:

  • User has loaded up a bunch of things in their shopping cart.
  • Your site can prompt them to (optionally?) make a payment from their Ethereum wallet.
  • Website creates the transaction, including:
    • Your contract (the "TO") address.
    • The request method (eg: makePayment).
    • The invoice number, or transaction id etc.
    • The amount of funds required.
  • Customer authorises the transaction and fund transfer.
  • The smart contract gets called and receives the funds.
  • Contract emits an event logging the payment action.
  • Website is subscribed to listen for the payment event from your contract.
  • Website processes the payment and ships the customer their goods.

You see, most of the logic was handled by the blockchain.

All your site really needed to do was create a transaction that would make a payment to the contract, and then listen for an event saying that payment was made.

Ethereum is all about putting more control in the hand of the customer and taking away the requirement for managing balances, credit card details and other chicanery from your backend servers.

  • thank you for nice explanation.. Is it not possible to have dummy addresses under main hot wallet of website? So all addresses deposit is gone under hot wallet. Similarly internal exchange has dummy address and that can't be looked upon in blockchain network – shawn Mar 20 '18 at 11:32
  • It is, but all addresses are a single individual entity. Since you are controller of the addresses, you could programmatically transfer all deposited funds to a central pool account, but there's no "hiding" of funds per-se. Ethereum is not a place to easily hide really. Alternatively you could create a smart contract per user that when transferred funds, automatically forwards those funds to a central account, but again, it's not hiding the funds. – norganna Mar 20 '18 at 11:52
  • If funds are automatically forwarded to pool account / cold wallet then it will cost GAS again. How to avoid network fee at the time of moving funds from address to Cold wallet – shawn Mar 20 '18 at 11:56
  • If you do it in a per-user smart contract at the time of the initial payment then the cost will be minimal (as it's just an extra .transfer() call, at most 2,300 gas) compared to the minimum fee of ~ 21,000 gas and the user will pay it. But you are correct, there is still a cost to doing things this way, and you will have to pay gas to setup the smart contract for each user as well. – norganna Mar 20 '18 at 12:10
  • I really have no idea of smart contract development, So i think for me its better to transfer all funds to COLD wallet with minimum gas and wait for transation to copleted – shawn Mar 20 '18 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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