Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Tool to convert btc pubkeys into btsx pubkeys  (Read 932 times)

0 Members and 1 Guest are viewing this topic.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12280
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Tool to convert btc pubkeys into btsx pubkeys
« on: September 14, 2014, 04:53:00 PM »

I modified the "bu.py" script from pycoin to produce BTSX pubkeys given a public key from bitcoin:

pycoin: https://github.com/richardkiss/pycoin.git
particular bu.py sourcecode: https://github.com/richardkiss/pycoin/blob/master/pycoin/scripts/bitcoin_utils.py

The patch looks like this:
Code: [Select]
*** pycoin/pycoin/scripts/bitcoin_utils.py      2014-09-14 16:32:55.171411937 +0200
--- btsxaddrutil/btsxaddr.py    2014-09-14 18:46:21.691527277 +0200
*************** from pycoin.ecdsa import secp256k1
*** 10,11 ****
--- 10,13 ----
 
+ BTS_ADDRESS_PREFIX = "BTS"
+
  def parse_as_number(s):
*************** def main():
*** 103,104 ****
--- 105,109 ----
              hash160_unc = encoding.public_pair_to_hash160_sec(public_pair, compressed=False)
+             myeccpoint = encoding.public_pair_to_sec(public_pair, compressed=True)
+             myhash     = encoding.ripemd160( myeccpoint ).digest(  )
+             print("BTSX PubKey:     %s" % BTS_ADDRESS_PREFIX + encoding.b2a_base58(myeccpoint + myhash[ :4 ]))
          else:
(patch comes as is ... no warranty ... AT ALL!! check results your self)

nothing too complicated .. but it took me some hours to figure it out :)

Output looks like this
Code: [Select]
─(%) ./btsxaddr.py 04c089455cd1554f05e723a1de8331fc0b947119966db60f4409036fdaf6663e1f5f61a8c0656704e98775382c240d8eb1ee0df827342fd7054b1284d41c1bea2c                                                                          ─┘
public pair x:   87086603698720170063321393822553237916438159845584726570308491679063372873247
public pair y:   43142269461068752177588100742336804615736633778602002937675098874341555431980
  x as hex:      c089455cd1554f05e723a1de8331fc0b947119966db60f4409036fdaf6663e1f
  y as hex:      5f61a8c0656704e98775382c240d8eb1ee0df827342fd7054b1284d41c1bea2c
even
key pair as sec: 02c089455cd1554f05e723a1de8331fc0b947119966db60f4409036fdaf6663e1f
  uncompressed:  04c089455cd1554f05e723a1de8331fc0b947119966db60f4409036fdaf6663e1f\
                   5f61a8c0656704e98775382c240d8eb1ee0df827342fd7054b1284d41c1bea2c
BTSX PubKey:     BTS6MHS4JNrh6wVVe1uZAugJbuQpJpr9ENYyaQ74fjv8DZUadY4fq
hash160:         fa6dc9a5cdd1a2d9b5bd1845a1201711ae4eb7ae
  uncompressed:  ef1567d36cd10b8fe6d0849123c22f1356cc90bb
Bitcoin address: 1Pq9T97Ces8HHBYaSr5jphxsW5EAmEUNNu
  uncompressed:  1NoA98grVfXfVqysU4ijM9jhMBD8vmrUC8
« Last Edit: November 26, 2014, 09:47:07 AM by xeroc »
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12280
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #1 on: November 26, 2014, 09:47:11 AM »
fixed "BTSX" -> "BTS"
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline cass

  • Hero Member
  • *****
  • Posts: 4328
  • /(┬.┬)\
    • View Profile
Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #2 on: November 26, 2014, 10:59:29 AM »
 +5%
█║▌║║█  - - -  The quieter you become, the more you are able to hear  - - -  █║▌║║█

Offline spartako

  • Sr. Member
  • ****
  • Posts: 401
    • View Profile
Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #3 on: November 26, 2014, 01:30:16 PM »
 +5%
wallet_account_set_approval spartako

Offline monsterer

Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #4 on: December 03, 2014, 05:23:25 PM »
I don't suppose you have the patched file to save me trying to figure out how to apply it? :)
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: 12280
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #5 on: December 03, 2014, 08:00:05 PM »
You just have to add those lines in the patch above that start with a + sign .. at the acording place .. or anywhere pretty below in the main procedure ..

Plus you need to define the prefix somewhere ... if you cant manage drop me a line and i can post a patches file .. i am mobile atm
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline monsterer

Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #6 on: December 05, 2014, 11:57:48 AM »
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

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12280
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #7 on: December 05, 2014, 12:48:15 PM »
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
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline monsterer

Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #8 on: December 05, 2014, 01:35:28 PM »
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: 12280
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #9 on: December 05, 2014, 02:29:08 PM »
Multiple keys per account .. yes
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline Thom

Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #10 on: December 05, 2014, 10:05:04 PM »
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 monsterer

Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #11 on: December 05, 2014, 10:44:25 PM »
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 NewMine

  • Hero Member
  • *****
  • Posts: 549
    • View Profile
Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #12 on: December 06, 2014, 04:07:27 AM »
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 xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12280
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #13 on: December 06, 2014, 12:56:51 PM »
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
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12280
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: Tool to convert btc pubkeys into btsx pubkeys
« Reply #14 on: December 06, 2014, 12:57:25 PM »
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 ..
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

 

Google+