You are viewing a single comment's thread from:

RE: 1000 STEEM bounty - need C code to create, sign and submit a multisig transaction locally for iguana atomic swap

in #iguana8 years ago

the above shows how to sign a transaction, but not specifically for a 2of2 multisig. Iguana has C library for secp256 already, so the actual signing code is already done. dealing with creating a 2of2 multisig account, serializing it properly for signing, submitting to the p2p network are the parts that are needed.

Let me address some of your points:

  • p2p network code is not required. All you need is a public API know
    for instance node.steem.ws. You can broadcast your tx with a few
    simple JSON-formated RPC calls.
  • Creating a multisig account isn't much of a problem if you want to use
    python code. In fact, the piston.steem library already has a call that
    allows you to setup some basic multisig account (see here)
  • Once you have created a multisig account, all you need to do is add
    more signatures
    to your signed transactions. If you have an account
    with two pubkeys as authority, then you need to sign it with the
    corresponding keys (you can do that in distinct steps). If you have
    another account as an authority, you can (AFAIK) sign with any of the
    keys of that account (owner, active, posting). -- Remark: I am not
    sure if a users posting key can actually be used to approve a multisig
    transaction that transfers funds.
Sort:  

unfortunately no python, needs to be C code. iguana is totally self-contained without any external libs and total codesize is 2MB, so everything needs to be in C to not bloat things.

good that can just post the tx to the public node.steem.ws

as far as the multisig goes, it needs to be something that once an account is configured locally (onetime setup) then automatically the multisig addresses need to be created, tx for it to be created, monitored, etc.

the multisig encodes secrets that are released during the atomic swap protocol and it in turn has a secret that it divulges when it is spent. I am assuming that like bitcoin, to spend a multisig the pubkey for it needs to be divulged. if not, some other mechanism is needed

Let's say Alice wants to exchange 10 bitUSD for 10 bitEuro with Bob. They create a new 2 of two multisig account between the two and send their funds to that account. Now they create a proposal that sends 10 bitUSD to Bob and 10 bitEuro to Alice. They both approve the proposal and the funds are exchanged. That's how I would do it (if not use the dex)

I have things setup so atomic swaps can be done between all bitcoin protocol coins, so if I can make the steemit do the arbitrary 2of2 multisig, then it can pretend it is a bitcoin protocol and that would allow atomic swaps of steem (and sbd?) against all the bitcoin compatibles