Author

Topic: Updating createTxFromAddrList (Read 850 times)

full member
Activity: 123
Merit: 100
June 30, 2014, 10:54:01 AM
#8
The extras directory has quite a bit of stale code. It does not routinely get updated.

If you encounter some bad code in that directory, you can either revert your local version of the repo to the last version of the file you are looking at.

Or, you can modify it to work with the latest version of the repo.

       
sr. member
Activity: 255
Merit: 250
Senior Developer - Armory
June 27, 2014, 05:53:44 PM
#7
I've been doing some poking around and have been updating createTxFromAddrList from the extra directory to start learning more about Armory.

Fair warning: As other team members have said, not all those scripts are necessarily up to date. If you're really curious, check out armoryd on the devel branch. I've actually taken some code from the other scripts and placed them in armoryd after updating them. Perhaps the day will come when somebody has time to update the other scripts, but until then, armoryd is your best bet.
newbie
Activity: 43
Merit: 0
June 27, 2014, 04:25:10 PM
#6
Please work on the devel branch ,which will shortly be merged into master (maybe 1-2 weeks).  If you figure out how it needs to be updated to work, you'll be saving us some time!  Smiley   But I'm not sure what I posted above will work.  I forgot how 0.91 handles things...

Will do, my original intention was to create a script that will break up an amount of bitcoins into random smaller chucks distributed across multiple keys based on what amount you have in any single address to help keep the amount of bitcoins you hold from being revealed by change. Still a little bit away from that goal but getting closer.
legendary
Activity: 1428
Merit: 1093
Core Armory Developer
June 27, 2014, 04:18:23 PM
#5
Also, what branch did you pull?

I pulled from 0.91-dev


I'll take a glance at it tonight.  Admittedly, those scripts have not been maintained as well as they should be.  I believe the public key map is just scrAddr->rawPubKey.    The signing device will need to know the public key to put into the sigscript, and it was simpler to have it passed through the data structure like this.

I think it's something like

Code:
pubKeyMap = dict([[SCRADDR_P2PKH_BYTE+hash160(pk), pk] for pk in pubKeyList])


Awesome, I'll see what I can do with that. Not promising I won't be back with more questions but it's a start. Thanks! Smiley

Please work on the devel branch ,which will shortly be merged into master (maybe 1-2 weeks).  If you figure out how it needs to be updated to work, you'll be saving us some time!  Smiley   But I'm not sure what I posted above will work.  I forgot how 0.91 handles things...
newbie
Activity: 43
Merit: 0
June 27, 2014, 04:16:16 PM
#4
Also, what branch did you pull?

I pulled from 0.91-dev


I'll take a glance at it tonight.  Admittedly, those scripts have not been maintained as well as they should be.  I believe the public key map is just scrAddr->rawPubKey.    The signing device will need to know the public key to put into the sigscript, and it was simpler to have it passed through the data structure like this.

I think it's something like

Code:
pubKeyMap = dict([[SCRADDR_P2PKH_BYTE+hash160(pk), pk] for pk in pubKeyList])


Awesome, I'll see what I can do with that. Not promising I won't be back with more questions but it's a start. Thanks! Smiley
legendary
Activity: 1428
Merit: 1093
Core Armory Developer
June 27, 2014, 02:58:54 PM
#3
I'll take a glance at it tonight.  Admittedly, those scripts have not been maintained as well as they should be.  I believe the public key map is just scrAddr->rawPubKey.    The signing device will need to know the public key to put into the sigscript, and it was simpler to have it passed through the data structure like this.

I think it's something like

Code:
pubKeyMap = dict([[SCRADDR_P2PKH_BYTE+hash160(pk), pk] for pk in pubKeyList])
legendary
Activity: 3766
Merit: 1364
Armory Developer
June 27, 2014, 02:55:49 PM
#2
I havent worked with this part of the code, however you're obviously not providing enough data for your intended operation. You can't go from hash160 to pubkey, you have to provide the pubkeys as well, as TxIns need the pubkey to verify the signature.

Also, what branch did you pull?
newbie
Activity: 43
Merit: 0
June 27, 2014, 02:36:24 PM
#1
I've been doing some poking around and have been updating createTxFromAddrList from the extra directory to start learning more about Armory. The new createFromTxOutSelection is where I am stuck and not sure what more I need to do. The code and comments are below:

Code:
# ACR:  To support P2SH in general, had to change createFromTxOutSelection
#       to take full scripts, not just hash160 values.  Convert the list
#       before passing it in
scrPairs = [[hash160_to_p2pkhash_script(r), v] for r,v in recip160List]
txdp = UnsignedTransaction().createFromTxOutSelection(selectedUtxoList, scrPairs)

This is what I get when running:

Code:
KeyDataError: Must give pubkey map for singlesig USTXI!

Which makes sense given:

Code:
def createFromTxOutSelection(self, utxoSelection, scriptValuePairs, pubKeyMap=None, txMap=None, p2shMap=None)

Anyone able to point me in the right direction on where I should be looking? Not sure what to do for creating the pubkey map.
Jump to: