I want to manually create ethereum addres from any str message like that:
const msg = '00'
const pk = bytesToHex(sha256(msg))
//pk is f1534392279bddbf9d43dde8701cb5be14b82f76ec6607bf8d6ad557f60f304e
const pub = secp256k1.getPublicKey(pk).substr(2)
//pub is 8fda47407e9a9ba47c4dbab6608ef73240530bb5e246261ec99d757832f5edf44e7e7eb6fc75b45e4ec1ca912b8f5e2c832d39dbf6abda76873e952a7fd13208
const rawAddress = bytesToHex(keccak_256(pub))
//bd5dd0b32f73c17fb0974b61dd1ca428ad2bd09d7f7a561d24099c4eb53fc0c3
here is a problem. According to this site https://www.royalfork.org/2017/12/10/eth-graphical-address/ my address must be this:
b91ef47f51856881969cbd13ef107311125acecff0fb6d989eca30d570683e46
but i`ve got this:
bd5dd0b32f73c17fb0974b61dd1ca428ad2bd09d7f7a561d24099c4eb53fc0c3
So where is the trick?
p.s. function keccak256 tested and works as expected.
p.s.s using pub key without substr(2) result into another incorrect address:
279f256123b10727bd8930f672d3bf6d82111b963a8182dfa6386836d42a578b