Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Pay/Sign to Contract instead of OP_RETURN for destination address #9

Open
gakonst opened this issue Oct 19, 2019 · 0 comments
Open

Comments

@gakonst
Copy link

gakonst commented Oct 19, 2019

Have you considered using pay-to-contract or sign-to-contract to commit to the destination address in the Tendermint chain instead of OP_RETURNs?

Puts less state on the chain, as well as guarantees the data can be retrieved by nodes which are not run with txindex=1

sign-to-contract basically modifies R in an ECDSA signature to also include the message you want to commit to (you also modify the nonce to ensure that the verification algorithm evaluates to true)

From the linked article:

def ECDSAsign2contract(x,m,c):
    k = deterministic_nonce(x,m)
    R = k*G
    e = k + h(R || c)
    Q = R + h(R || c)*G  # which is Q = e*G = C(c,R)
    q = Q.x mod n
    z = e^(-1) * (m + q*x) mod n
    return (q,z), R
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant