From f17e6bf44c323d0b8883963428bc774aefebfda8 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 10 Apr 2017 03:01:35 -0700 Subject: [PATCH] Fix bitcoin addr scheme --- hd/address.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hd/address.go b/hd/address.go index 139707e46..28f70a98f 100644 --- a/hd/address.go +++ b/hd/address.go @@ -219,7 +219,7 @@ func I64(key []byte, data []byte) ([]byte, []byte) { // This returns a Bitcoin-like address. func AddrFromPubKeyBytes(pubKeyBytes []byte) string { - prefix := byte(0x80) // TODO Make const or configurable + prefix := byte(0x00) // TODO Make const or configurable h160 := CalcHash160(pubKeyBytes) h160 = append([]byte{prefix}, h160...) checksum := CalcHash256(h160) @@ -228,7 +228,7 @@ func AddrFromPubKeyBytes(pubKeyBytes []byte) string { } func AddrBytesFromPubKeyBytes(pubKeyBytes []byte) (addrBytes []byte, checksum []byte) { - prefix := byte(0x80) // TODO Make const or configurable + prefix := byte(0x00) // TODO Make const or configurable h160 := CalcHash160(pubKeyBytes) _h160 := append([]byte{prefix}, h160...) checksum = CalcHash256(_h160)[:4]