code: func determinePublicKey(sig, pubkeyX []byte) ([]byte, error) {
  	for v := 0; v < 2; v++ {
  		sig[64] = byte(v)
  		pubkey, err := crypto.Ecrecover(DerivationSignatureHash[:], sig)
  		if err == nil {
  			if bytes.Equal(pubkey, pubkeyX) {
  				return pubkey, nil
  			}
  		} else if v == 1 || err != secp256k1.ErrRecoverFailed {
  			return nil, err
  		}
  	}
  	return nil, ErrPubkeyMismatch
  }
docs: // determinePublicKey uses a signature and the X component of a public key to
  // recover the entire public key.