I am wondering how to create the multisig accounts for stellar. I am using "py-stellar-base" SDK to send the transactions. Below is the code which sends the lumens from one address to other
from stellar_base.keypair import Keypair
from stellar_base.asset import Asset
from stellar_base.operation import Payment,SetOptions
from stellar_base.transaction import Transaction
from stellar_base.transaction_envelope import TransactionEnvelope as Te
from stellar_base.memo import TextMemo
from stellar_base.horizon import horizon_testnet, horizon_livenet
alice_public_key = 'GD2HPONSMOTEJQUE2WIUBPMWZ7WPAE7EBLW2RRD2XH6CIJHKCZKAYMZ3'
alice_seed = 'SCQUFZIFKMF3CYXAYKPKBQZRF33O3YKJMQXL63PVW7O66GBQOTVKR3A5'
bob_address = 'GCGUHPNOCTJVOC7YQUX6UG6L3S6PUPHNZJFEVSVSP56GJIC7OBCNXHUA'
amount = '10'
Alice = Keypair.from_seed(alice_seed)
horizon = horizon_testnet() # horizon = horizon_livenet() for LIVENET
# asset = Asset('CNY', CNY_ISSUER)
asset = Asset("XLM")
# create op
op = Payment({
# 'source' : Alice.address().decode(),
'destination': bob_address,
'asset': asset,
'amount': amount
})
msg = TextMemo('Buy yourself a beer !')
# get sequence of Alice
# Python 2
# sequence = horizon.account(Alice.address()).get('sequence')
# Python 3
sequence = horizon.account(Alice.address().decode('utf-8')).get('sequence')
# construct Tx
tx = Transaction(
source = Alice.address().decode('utf-8'),
opts = {
'sequence': sequence,
# 'timeBounds': [],
'memo': msg,
'fee': 100,
'operations': [
op
],
},
)
# build envelope
envelope = Te(tx=tx, opts={"network_id": "TESTNET"}) # envelope = Te(tx=tx, opts={"network_id": "PUBLIC"}) for LIVENET
# sign
envelope.sign(Alice)
sec = Keypair.from_seed(second_private_key)
envelope.sign(sec)
third = Keypair.from_seed(third_private_key)
envelope.sign(third)
# submit
xdr = envelope.xdr()
response = horizon.submit(xdr)
I can't get how to generate the multisig address and to create multisig account. Could anyone please help me out?