Author Topic: Tool to convert btc pubkeys into btsx pubkeys  (Read 4462 times)

0 Members and 1 Guest are viewing this topic.

Offline Strip

  • Full Member
  • ***
  • Posts: 63
    • View Profile
here we go .. I just updated the "pytshares" repo on github .. now there are two different scripts:

Code: [Select]
└─(1:%) ./genbtskey.py                                                                                                                                                                                                          ─┘
Secret Exponent         : b3a5255b0567f73da73a27663c0ea5998c67cb6bf860f6dad23af7c1f03290b5
Private Key             : 5KBQNg7LVWcfyZKYzYMVnwsV3d1JS351rD6EhddZvSSzpX2C34X
BTC Address             : 1Bfy6Pv7t1z4hXW89zGHbydnspevDdg9fN
--------------------------------------------------------------------------------
BTC Pubkey (compressed) : 02885d9abff5ca754bdea9c70c9fd95f3d1ea9200b563b2e43081a4d75bc63a1e5
BTC Address             : 1Bfy6Pv7t1z4hXW89zGHbydnspevDdg9fN
--------------------------------------------------------------------------------
BTS PubKey              : BTS5vYdYntohDkUyCCUmzp1QZE2isBwyS6ZARdA6P4gxWgzvFr9qz
BTS Address             : BTSPfYihuV1t7f7HczrY4oJXoX9tULALksLD
--------------------------------------------------------------------------------
┌─(xeroc@hermike:pts/2)────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────(~/pytshares)─┐
└─(%) ./convertbtcpubkey.py 02885d9abff5ca754bdea9c70c9fd95f3d1ea9200b563b2e43081a4d75bc63a1e5                                                                                                                                  ─┘
BTC PubKey      : 02885d9abff5ca754bdea9c70c9fd95f3d1ea9200b563b2e43081a4d75bc63a1e5
BTC Address     : 1BSxmaYgptZ2ZZeknMN8wNjmHViyW8SpC4
BTS PubKey      : BTS5vYdYntohDkUyCCUmzp1QZE2isBwyS6ZARdA6P4gxWgzvFr9qz
BTS Address     : BTSPfYihuV1t7f7HczrY4oJXoX9tULALksLD


Thank you a lot! Testing.

Seems working in both scripts(modified bitcoin_utils.py and new convertbtcpubkey.py . Just needed to import compressed public key.
« Last Edit: December 09, 2014, 10:04:37 pm by Strip »
BTS: strip

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
here we go .. I just updated the "pytshares" repo on github .. now there are two different scripts:

Code: [Select]
└─(1:%) ./genbtskey.py                                                                                                                                                                                                          ─┘
Secret Exponent         : b3a5255b0567f73da73a27663c0ea5998c67cb6bf860f6dad23af7c1f03290b5
Private Key             : 5KBQNg7LVWcfyZKYzYMVnwsV3d1JS351rD6EhddZvSSzpX2C34X
BTC Address             : 1Bfy6Pv7t1z4hXW89zGHbydnspevDdg9fN
--------------------------------------------------------------------------------
BTC Pubkey (compressed) : 02885d9abff5ca754bdea9c70c9fd95f3d1ea9200b563b2e43081a4d75bc63a1e5
BTC Address             : 1Bfy6Pv7t1z4hXW89zGHbydnspevDdg9fN
--------------------------------------------------------------------------------
BTS PubKey              : BTS5vYdYntohDkUyCCUmzp1QZE2isBwyS6ZARdA6P4gxWgzvFr9qz
BTS Address             : BTSPfYihuV1t7f7HczrY4oJXoX9tULALksLD
--------------------------------------------------------------------------------
┌─(xeroc@hermike:pts/2)────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────(~/pytshares)─┐
└─(%) ./convertbtcpubkey.py 02885d9abff5ca754bdea9c70c9fd95f3d1ea9200b563b2e43081a4d75bc63a1e5                                                                                                                                  ─┘
BTC PubKey      : 02885d9abff5ca754bdea9c70c9fd95f3d1ea9200b563b2e43081a4d75bc63a1e5
BTC Address     : 1BSxmaYgptZ2ZZeknMN8wNjmHViyW8SpC4
BTS PubKey      : BTS5vYdYntohDkUyCCUmzp1QZE2isBwyS6ZARdA6P4gxWgzvFr9qz
BTS Address     : BTSPfYihuV1t7f7HczrY4oJXoX9tULALksLD


Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
xeroc,

I'm struggling too understand how to use this code for several hour by now. Can you explain a little bit, please.

I have the BTC address and I want to convert in BTS format. What argument to btsxaddr.py should I give?
It won't take BTC address. But it take hash160 but results not identical if I give the private key for the same address.
Oh .. I should write some more lines about that ...
the genbts.py script int "pytshares" is just createing a private key and the bts addresses ..

if you only have the public key and want that one converted to bts address you need to use my modified "pycoin" repo and install that one .. than you can use the bitcoin_utils.py (or "bu") tool that is installed .. that one takes the pubkey and converts it to the pubkey and address ..
I will try to write a separated file to do that .. give me 30 minutes or so .

Offline Strip

  • Full Member
  • ***
  • Posts: 63
    • View Profile
xeroc,

I'm struggling too understand how to use this code for several hour by now. Can you explain a little bit, please.

I have the BTC address and I want to convert in BTS format. What argument to btsxaddr.py should I give?
It won't take BTC address. But it take hash160 but results not identical if I give the private key for the same address.

Brainwallets can be uses in the original client too... check this out:

   help wallet_create
Holy moly! It is so easy!
« Last Edit: December 09, 2014, 08:36:43 pm by Strip »
BTS: strip

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
+5%
Thank you! It's awesome! Now we could do brain wallets!
Brainwallets can be uses in the original client too... check this out:

   help wallet_create

Offline Strip

  • Full Member
  • ***
  • Posts: 63
    • View Profile
 +5%
Thank you! It's awesome! Now we could do brain wallets!
BTS: strip

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Can I create a BTS address through oclvanitygen, then import it and register the key to a Titan name? If so what would the -X flag variable be?
Not without major code modifications ..

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
What is the implication of this?

It sounds similar to sharedropping but rather than coins / shares it is addresses.

Does this imply you could send BTS to a bitcoin account, or a bitcoin account could send BTC to to a BTS wallet?

It does, but think in terms of bitBTC instead of BTS :)
you cannot do crosschain transactions .. but you can reuse the.private key ..

If you want to send 2bitUSD to someone only having a btc pubkey (address) you can convert the pubkey to a bts pubkey or address and send BTS there .. the other guy can redeem the bts by importing the btc privkey into bts

Offline NewMine

  • Hero Member
  • *****
  • Posts: 552
    • View Profile
Can I create a BTS address through oclvanitygen, then import it and register the key to a Titan name? If so what would the -X flag variable be?

Offline monsterer

What is the implication of this?

It sounds similar to sharedropping but rather than coins / shares it is addresses.

Does this imply you could send BTS to a bitcoin account, or a bitcoin account could send BTC to to a BTS wallet?

It does, but think in terms of bitBTC instead of BTS :)
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline Thom

What is the implication of this?

It sounds similar to sharedropping but rather than coins / shares it is addresses.

Does this imply you could send BTS to a bitcoin account, or a bitcoin account could send BTC to to a BTS wallet?
Injustice anywhere is a threat to justice everywhere - MLK |  Verbaltech2 Witness Reports: https://bitsharestalk.org/index.php/topic,23902.0.html

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Multiple keys per account .. yes

Offline monsterer

Never worked wih addresses... but you can take a random key .. import into the wallet and  heck with wallet_account_list_public_keys .. it shows the pubkey and adresses

Using wallet_import_private_key?

edit: does this overwrite the private key of the account?.... I guess it can't actually. So there are multiple private keys for each account?
« Last Edit: December 05, 2014, 02:12:25 pm by monsterer »
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Never worked wih addresses... but you can take a random key .. import into the wallet and  heck with wallet_account_list_public_keys .. it shows the pubkey and adresses

Offline monsterer

Can I get a confirmation on this pseudo code for going from bitcoin pub key to BTS address?

Code: [Select]
addr = ripemd160(sha512(bitcoinPubKeyBinary))
check = ripemd160(addr)
finalBinary = addr + first_four_bytes(check)
finalBase58 = 'BTS' + base58(finalBinary)
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads