1

I created a random entropy using this code

func randomNumGenerator() []byte {

    n := 16
    randomByte := make([]byte, n)
    _, err := rand.Read(randomByte)
    if err != nil {
        panic(err)
    }

    return randomByte
}

And created a checksum

func checkSum(entropy *string) {

    data := *entropy
    checkSumLength := len(*entropy) / 32

    //Sha256 of entropy
    hash := sha256.Sum256([]byte(data))
    // hexFormat := hex.EncodeToString(hash[:])

    bitHash := byteToBit(hash[:])
    *entropy = *entropy + bitHash[0:checkSumLength]

}

And added that to the end of the entropy and divided that entropy into 11 bits equal parts and matched it with the 2048 word list and I got words

"sustain resemble shift future stone merge antique denial devote century clay chalk"

But when I use this words in trust wallet it's showing invalid seed phrase

Can anyone explain me why? I followed all BIP39 procedures correctly in my code

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.