Address() returns the short version of the public key Address format varies between chains: - Cosmos, Harmony, Binance, Avalanche RIPEMD-160(SHA-256(pubkey)) - BTC, BCH, BSV, (and other forks) <1 byte version> + RIPEMD-160(SHA-256(pubkey)) + <4 byte Checksum> `RIPEMD-160(SHA-256(pubkey)
()
| 160 | // - BTC, BCH, BSV, (and other forks) <1 byte version> + RIPEMD-160(SHA-256(pubkey)) + <4 byte Checksum> |
| 161 | // `RIPEMD-160(SHA-256(pubkey))` seems to be the most common theme in addressing for SECP256K1 public keys |
| 162 | func (s *SECP256K1PublicKey) Address() AddressI { |
| 163 | hasher := ripemd160.New() |
| 164 | hasher.Write(Hash(s.Bytes())) |
| 165 | address := Address(hasher.Sum(nil)) |
| 166 | return &address |
| 167 | } |
| 168 | |
| 169 | // VerifyBytes() returns true if the digital signature is valid for this public key and the given message |
| 170 | func (s *SECP256K1PublicKey) VerifyBytes(msg []byte, sig []byte) (valid bool) { |