How does ethereum generate Smart Contract addresses? It is any different from Ethereum generating addresses for accounts, (which uses rightmost 160 bits of the keccak256(Elliptic curve pub key) - see yellow paper). Does the ethereum contract generation differ from account address generation?
The address for smart contracts are generated using the nonce of the contract creation transaction and the address of the contract creator. This is different than EOA address creation which is simply generating a 256 bit private key.
Take a look here.
In Python, using pyethereum:
def mk_contract_address(sender, nonce): return sha3(rlp.encode([normalize_address(sender), nonce]))[12:]