code: func SigToPub(hash, sig []byte) (*ecdsa.PublicKey, error) {
  	// Convert to btcec input format with 'recovery id' v at the beginning.
  	btcsig := make([]byte, 65)
  	btcsig[0] = sig[64] + 27
  	copy(btcsig[1:], sig)
  
  	pub, _, err := btcec.RecoverCompact(btcec.S256(), btcsig, hash)
  	return (*ecdsa.PublicKey)(pub), err
  }
docs: // SigToPub returns the public key that created the given signature.