I have an assignment from my prof to make an ethereum exchange. Is it possible to use HD wallet to generate multiple public address for all the customers? if so, what is the easiest implementation?
Yes, it should be possible.
You can use a library like ethereumjs-wallet that provides an API to manage HD wallets.
const hdkey = require('ethereumjs-wallet/hdkey'); // Bip39 only if you use mnemonic seed const bip39 = require('bip39'); const mnemonic = "interest plate fix ..."; const seed = bip39.mnemonicToSeed(mnemonic); // Obtain master wallet const masterWallet = hdkey.fromMasterSeed(seed); // Obtain user wallet using derivation path, // userId is an integer between 0 and 2^31-1 const userId = 1234; // For security reasons you likely use a different path // and have to understand the difference between // normal and hardened keys const userPath = "m/44'/60'/0'/0/" + userId; const userWallet = masterWallet.derivePath(userPath).getWallet();