You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
774 B

  1. package hd
  2. /*
  3. import (
  4. "encoding/hex"
  5. "fmt"
  6. "testing"
  7. )
  8. func TestManual(t *testing.T) {
  9. bytes, _ := hex.DecodeString("dfac699f1618c9be4df2befe94dc5f313946ebafa386756bd4926a1ecfd7cf2438426ede521d1ee6512391bc200b7910bcbea593e68d52b874c29bdc5a308ed1")
  10. fmt.Println(bytes)
  11. puk, prk, ch, se := ComputeMastersFromSeed(string(bytes))
  12. fmt.Println(puk, ch, se)
  13. pubBytes2 := DerivePublicKeyForPath(
  14. HexDecode(puk),
  15. HexDecode(ch),
  16. //"44'/118'/0'/0/0",
  17. "0/0",
  18. )
  19. fmt.Printf("PUB2 %X\n", pubBytes2)
  20. privBytes := DerivePrivateKeyForPath(
  21. HexDecode(prk),
  22. HexDecode(ch),
  23. //"44'/118'/0'/0/0",
  24. //"0/0",
  25. "44'/118'/0'/0/0",
  26. )
  27. fmt.Printf("PRIV %X\n", privBytes)
  28. pubBytes := PubKeyBytesFromPrivKeyBytes(privBytes, true)
  29. fmt.Printf("PUB %X\n", pubBytes)
  30. }
  31. */