'See http://www.secg.org/download/aid-780/sec1-v2.pdf, chapter 4.1.6'

@classmethod
def from_signature(klass, sig, recid, h, curve):

    from ecdsa import util, numbertheory
    import msqr
    curveFp = curve.curve
    G = curve.generator
    order = G.order()
    (r, s) = util.sigdecode_string(sig, order)
    x = (r + ((recid / 2) * order))
    alpha = (((((x * x) * x) + (curveFp.a() * x)) + curveFp.b()) % curveFp.p())
    beta = msqr.modular_sqrt(alpha, curveFp.p())
    y = (beta if (((beta - recid) % 2) == 0) else (curveFp.p() - beta))
    R = Point(curveFp, x, y, order)
    e = string_to_number(h)
    minus_e = ((- e) % order)
    inv_r = numbertheory.inverse_mod(r, order)
    Q = (inv_r * ((s * R) + (minus_e * G)))
    return klass.from_public_point(Q, curve)
