Bitcoin Forum
April 28, 2024, 06:47:08 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Python programmer for a multisig implementation  (Read 250 times)
svabodny (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
December 20, 2016, 06:27:36 PM
 #1

I'm looking for a python programmer who would write a simple program doing the following:

- Generate 5 signatures
- Create an address with 3 of 5 signatures required for payout ( notice: 2of3 is much different in implementation from 3of5! )
- Monitor the address for upcoming transactions
- Withdraw from the address

No UX necessary - I'm just interested in functions, so I can use them as a part of a bigger project.

Please PM, or post publicly: time estimates, price, past experience
Bitcoin addresses contain a checksum, so it is very unlikely that mistyping an address will cause you to lose money.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714330028
Hero Member
*
Offline Offline

Posts: 1714330028

View Profile Personal Message (Offline)

Ignore
1714330028
Reply with quote  #2

1714330028
Report to moderator
weex
Legendary
*
Offline Offline

Activity: 1102
Merit: 1014



View Profile
December 21, 2016, 07:10:15 AM
 #2

I'm not sure that 3-of-5 needs to be much different than 2-of-3 but here's some code that'll do it. This is from Rein (http://reinproject.org) which generates 2-of-3 addresses to escrow freelancing transactions.

Code:
from bitcoin.core import b2x, lx, x
from bitcoin.core.script import CScript, OP_CHECKMULTISIG, OP_CHECKSIGVERIFY
from bitcoin.wallet import CBitcoinAddress

pubkeys = ['0304B9F99B92F1DB45423A741B12DD59F92666865A6FC348C4BC23685A4E3EE871',
    '02B4F0BF69C91018259127008EAC434E79ACD7EF47A0D100F4E76C73498E63D029',                                                              
    '026933041E0B3EF4382CFFA5B2ADCB9D8A45A450827BEF8F14E6154013C0DEE77C',
    '028898A9805506DBD73DF96DD6186E651F41FC89DE6973730E0EF03C7CA75F4890',      
    '030BD98B6B6A4228E47A23A34CE339655BF234791171B76C985219E5BC656CD057']

def build_3_of_5(pubkeys):
     txin_redeemScript = CScript([3, x(pubkeys[0]), x(pubkeys[1]), x(pubkeys[2]), x(pubkeys[3]), x(pubkeys[4]), 5, OP_CHECKMULTISIG])
     txin_scriptPubKey = txin_redeemScript.to_p2sh_scriptPubKey()
     txin_p2sh_address = CBitcoinAddress.from_scriptPubKey(txin_scriptPubKey)
     return (b2x(txin_redeemScript), str(txin_p2sh_address))

At least the redeem script this generated checked out ok with https://coinb.in

output:
Code:
('53210304b9f99b92f1db45423a741b12dd59f92666865a6fc348c4bc23685a4e3ee8712102b4f0bf69c91018259127008eac434e79acd7ef47a0d100f4e76c73498e63d02921026933041e0b3ef4382cffa5b2adcb9d8a45a450827bef8f14e6154013c0dee77c21028898a9805506dbd73df96dd6186e651f41fc89de6973730e0ef03c7ca75f489021030bd98b6b6a4228e47a23a34ce339655bf234791171b76c985219e5bc656cd05755ae',
 '3HHn8SQPUrpeynkYP4ZqodGDpTsxiJMVDN')
svabodny (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
December 21, 2016, 12:11:41 PM
 #3

It seems it was what I was looking for, thank you! Any way I can tip you?
weex
Legendary
*
Offline Offline

Activity: 1102
Merit: 1014



View Profile
December 21, 2016, 04:18:28 PM
 #4

Sure. Pm'd address.

Good luck with your project!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!