code: func EnsureEd25519PrivateKeyCorrect(candidatePrivateKey ed25519.PrivateKey) error {
  	if len(candidatePrivateKey) != ed25519.PrivateKeySize {
  		return fmt.Errorf("ed25519 key has size %v but %v bytes passed as key", ed25519.PrivateKeySize,
  			len(candidatePrivateKey))
  	}
  	_, derivedPrivateKey, err := ed25519.GenerateKey(bytes.NewBuffer(candidatePrivateKey))
  	if err != nil {
  		return err
  	}
  	if !bytes.Equal(derivedPrivateKey, candidatePrivateKey) {
  		return fmt.Errorf("ed25519 key generated from prefix of %X should equal %X, but is %X",
  			candidatePrivateKey, candidatePrivateKey, derivedPrivateKey)
  	}
  	return nil
  }
docs: // Ensures the last 32 bytes of the ed25519 private key is the public key derived from the first 32 private bytes