Bitcoin Forum
May 23, 2024, 04:19:48 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Economy / Trading Discussion / Re: How friendly is HSBC with bitcoin? on: May 16, 2015, 09:26:11 PM
Sorry if this is the wrong section. I was wondering, is HSBC okay with bitcoin?
For individual accounts, yes, HSBC is bitcoin friendly. For
LLC or Corp accounts, no, not ok with bitcoin. If you have
a personal "Premier" account, you can get money to
Chinese exchanges faster with linked account transfer
(instant) and then domestic wire.
2  Bitcoin / Project Development / Re: Python snippet to create Bitcoin public/private key pairs on: May 16, 2015, 04:01:06 AM
How can I get the format 1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm (public key) and 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf (private key) ?
Your "public key" is actually a bitcoin address, and your "private
key" has been WIF encoded.

Here is a revised snippet:

Quote
from ecdsa.ecdsa import *
from binascii import hexlify, unhexlify
import hashlib

__zeros = '0000000000000000000000000000000000000000000000000000000000000000'
__b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
__b58base = len(__b58chars)

def b58encode(v):
  long_value = 0L
  for (i, c) in enumerate(v[::-1]):
    long_value += (256**i) * ord(c)
  result = ''
  while long_value >= __b58base:
    div, mod = divmod(long_value, __b58base)
    result = __b58chars[mod] + result
    long_value = div
  result = __b58chars[long_value] + result
  nPad = 0
  for c in v:
    if c == '\0': nPad += 1
    else: break
  return (__b58chars[0]*nPad) + result


def getKeys(secretNumber):
  rpmd160hash = hashlib.new('ripemd160')
  pubKey = Public_key(generator_secp256k1,generator_secp256k1*secretNumber)
  formattedPubKey = '\x04'+int_to_string(pubKey.point.x())+int_to_string(pubKey.point.y())
  rpmd160hash.update(hashlib.sha256(formattedPubKey).digest())
  btcAddress = '\x00'+rpmd160hash.digest()
  chksum = hashlib.sha256(hashlib.sha256(btcAddress).digest()).digest()[:4]
  btcAddress = b58encode(btcAddress+chksum)
  formattedPubKey = hexlify(formattedPubKey)
  formattedPrivKey = hexlify(int_to_string(secretNumber))
  formattedPrivKey = '80'+__zeros[0:64-len(formattedPrivKey)]+formattedPrivKey
  formattedPrivKey = unhexlify(formattedPrivKey)
  chksum = hashlib.sha256(hashlib.sha256(formattedPrivKey).digest()).digest()[:4]
  formattedPrivKey = b58encode(formattedPrivKey+chksum)
  return (btcAddress,formattedPrivKey, formattedPubKey)


secretNumber = 10000000000000000000
bitcoinAddress, privateKey, publicKey = getKeys(secretNumber)
print 'SecretNumber: ',secretNumber
print 'BitcoinAddress: '+bitcoinAddress
print 'PrivateKey: '+privateKey
print 'PublicKey: '+publicKey

3  Bitcoin / Project Development / Re: Python snippet to create Bitcoin public/private key pairs on: May 15, 2015, 10:10:50 PM
I am looking for a Python snippet to create public/private key pairs for Bitcoin just by providing an arbitrary number between 1 and 10^77. Can someone provide such a snippet?

Try this:
Quote
from ecdsa.ecdsa import *
from binascii import hexlify

def getKeys(secretNumber):
  pubKey = Public_key(generator_secp256k1,generator_secp256k1*secretNumber)
  formattedPubKey = hexlify('\x04'+int_to_string(pubKey.point.x())+int_to_string(pubKey.point.y()))
  formattedPrivKey = hex(secretNumber)[2:-1]
  return (formattedPrivKey, formattedPubKey)


If you don't have python-ecdsa installed, you can
get it here: https://github.com/warner/python-ecdsa
4  Economy / Trading Discussion / Re: Bitfinex OHLC 5 min data on: May 14, 2015, 07:24:12 AM
Hello,

I'm looking for Bitfinex OHLC 5 min data.

Actually all I care about is just the close data or just open data for 5 minutes Bitfinex.

Anyone know how I can get that?

I don't see any way to attach files to replies here so I uploaded
a bitfinex five minute bar file to MegaUpload at this address:

http://www.megafileupload.com/15lS/BitFinex_5Min_Bars_BTCUSD.rar

You can download the trade-by-trade data here:

http://api.bitcoincharts.com/v1/csv/

I use a simple awk script to parse it into five minute bars:

Quote
BEGIN{
  prevIncr = 99999;
  minutesInBar = 5;
}
{ nowTemp = $1%1000000;
  nowDay = int($1/1000000);
  nowHour = int(nowTemp/10000);
  nowMinute = int((nowTemp%10000)/100);
  nowIncr =  int((nowMinute+nowHour*60)/minutesInBar);
 
  if(nowIncr!=prevIncr)
  { if(prevIncr!=999999)
    { prevTemp = prevIncr*minutesInBar;
      prevHour = int(prevTemp/60)*100;
      prevMinute = prevTemp%60;
      prevTemp = prevHour+prevMinute;
      printf("%d, %4d,%7.2f,%7.2f,%7.2f,%7.2f,%11.5f,%5d\n",prevDay,prevTemp,openBar,highBar,lowBar,lastBar,sizeBar,tickCount);
    }
    openBar = $2;
    highBar = $2;
    lowBar = $2;
    sizeBar = 0;
    tickCount = 0;
  }
  if($2>highBar){ highBar=$2;}
  if($2<lowBar){ lowBar=$2;}
  lastBar = $2;
  sizeBar += $3;
  prevDay = nowDay;
  prevIncr = nowIncr;
  prevBar = $0;
  tickCount += 1;
}
END{
  prevTemp = prevIncr*minutesInBar;
  prevHour = int(prevTemp/60)*100;
  prevMinute = prevTemp%60;
  prevTemp = prevHour+prevMinute;
  printf("%d, %4d,%7.2f,%7.2f,%7.2f,%7.2f,%11.5f,%5d\n",prevDay,prevTemp,openBar,highBar,lowBar,lastBar,sizeBar,tickCount);
}
5  Economy / Trading Discussion / Re: What is your trading strategy? on: May 01, 2015, 06:49:09 AM
any body here using martiangle strategy to trading bitcoin or altcoin?
how about this trading. profitabel or not?
Yes, I've been using a volatility pump/universal portfolio
approach since mid-January. This has been pretty successful
so far. Quite similar to a martingale betting scheme, also
similar to Edelman's Value Averaging method. The Gummy
Stuff site has an Excel implementation up, if you are
interested.
6  Economy / Trading Discussion / Re: what about this trading strategy Bitcoin on: April 12, 2015, 08:51:00 PM
It is arbitrage buying cheap ...
how long it takes withdrawing fiat to OKpay or PerfectMoney so i can make the same circle more than once a day or not?
am i dreaming Roll Eyes
Yes, you are dreaming. At least at present. Fees
and turnaround time make this a losing proposition.
At one point last month you could pull this between
BitYes (buying BTC) and Coinbase (selling BTC).
That was because of low fees -- both Coinbase
and Bityes were running zero fees for makers.
Turnaround time was more or less one day with
Coinbase consistently at a $2 premium to Bityes.

However this relied on using Astropay to get
USD quickly back to Bityes from Coinbase with
zero fees. Now Bityes has reinstituted maker
fees, suspended Astropay deposits, and the
average premium as fallen to ~$1.
7  Bitcoin / Press / Re: [2015-04-09] Video: Follow The Coin Exclusive Interview With Adam Draper on: April 10, 2015, 02:00:03 AM

Adam needs a video coach. Seriously. He is in an influential
position and what he says makes sense. But his presentation
is sub-par.

Follow The Coin Exclusive Interview With Adam Draper: Sign The Petition For A Revised BitLicense

https://www.youtube.com/watch?v=2WbPP1vbUDo&feature=share
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!