Search content
Sort by

Showing 20 of 32 results by Martin P. Hellwig
Post
Topic
Board Development & Technical Discussion
Re: Version Message and addrYou / addrMe
by
Martin P. Hellwig
on 14/07/2011, 23:27:11 UTC
Well I thought about that one but I have to swap both of them that is incoming and outgoing to make sense.
Post
Topic
Board Development & Technical Discussion
Topic OP
Version Message and addrYou / addrMe
by
Martin P. Hellwig
on 14/07/2011, 17:33:36 UTC
Hi all, I am a bit confused here:
According to the spec and main.cpp the version message should be first me and then you:
(line 2364)
        int64 nTime;
        CAddress addrMe;
        CAddress addrFrom;
        uint64 nNonce = 1;

but from what I see over the network it is more the otherway around, as net.h would suggest too:
line 743
    void PushVersion()
    {
        /// when NTP implemented, change to just nTime = GetAdjustedTime()
        int64 nTime = (fInbound ? GetAdjustedTime() : GetTime());
        CAddress addrYou = (fUseProxy ? CAddress("0.0.0.0") : addr);
        CAddress addrMe = (fUseProxy ? CAddress("0.0.0.0") : addrLocalHost);
        RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce));
        PushMessage("version", VERSION, nLocalServices, nTime, addrYou, addrMe,
                    nLocalHostNonce, std::string(pszSubVer), nBestHeight);
    }

As I am not proficient in cpp, I don't really know now what is going on.
Could someone shed a bit more light on this please?

Thanks,

Martin
Post
Topic
Board Bitcoin Discussion
Re: Oh the irony!!!
by
Martin P. Hellwig
on 13/07/2011, 20:17:19 UTC

Seriously though, how is a mugger going to get bitcoins off your android if you dont' tell him the password? This will take a very sophisticated mugger.
[/quote]

Never underestimate the persuasive power of a baseball bat :-)
Post
Topic
Board Bitcoin Discussion
Re: Can bitcoin fill the void in a bank run?
by
Martin P. Hellwig
on 12/07/2011, 19:53:17 UTC
Am I missing the point or do I not understand your question?
What do you actually mean by filling the void? As I interpret it as: All fiat currencies have gone to smithereens and people lost all value in it and need to start again from scratch, perhaps by using bitcoin? Yes of course in that scenario bitcoin can fill the void, as can seashells, garden peas and whatever else you can convince other people to accept for trading.

In any other scenario, it would be the same question as; Can pesos fill the void in a bank run?
Post
Topic
Board Development & Technical Discussion
Re: What EXACTLY means "longest" chain ?
by
Martin P. Hellwig
on 09/07/2011, 23:15:20 UTC
I sincerely hope that the amount of transactions in the block is a factor in defining the longest chain, but I don't know.
Post
Topic
Board Wallet software
Re: Caesure - a Python Bitcoin Client
by
Martin P. Hellwig
on 09/07/2011, 02:21:49 UTC
So with this in future I can replace bitcoind+JSON or this is just API for bitcoind?

As far as I can read the code (I am sure that Sam will refactor the code ones he is happy with the functionality, so it is easier to read/maintain/extend for mere mortals  Wink ), this is aimed to be a full implementation of the reference c++ bitcoin implementation.

So in other words, where you used to run the bitcoin client downloaded from bitcoin.org, you can alternatively use his python one instead.

Good to see I am not the only one working on a Python implementation, a little bit of competition is a good thing :-)

Cheers Sam, good work!
Post
Topic
Board Bitcoin Discussion
Re: Best 1-3 line selling pitch for Bitcoin
by
Martin P. Hellwig
on 07/07/2011, 17:14:42 UTC
Bitcoin; Trusted by more paranoids than any other currency.

Bitcoin; You don't have to trust me, just that 1+1=2.

Bitcoin; Don't bother if your happy not to own your money.

Bitcoin; When was the last time you where happy with your bank?

Bitcoin; When was the last time you where happy with your governments financial ruling?

Post
Topic
Board Development & Technical Discussion
Re: Wallet file guard
by
Martin P. Hellwig
on 06/07/2011, 22:48:53 UTC
Probably americans can buy all the software they want and it costs to them less than they spend on dinner in restourant. But for some people not so lucky to born in developed country and rich parents, the software costs are too high. For example MS Office Enterprise will cost me about 2 years of income. And none want to use inferior alternatives. Yes, I can use Open Office and I like OOo, but I also like to have both MS Office 2007 Enterprise and OOo on my computer. If OOo will have problems with some docs, I will use the MS Office with the sucky ribbon.

You might want to consider looking for a technet subscription, in 'non-developed' countries MS usually throws it in free if you ask them nicely and say that you are a starting developer on 'their' platform. With that subscription you can pretty much download every piece of mainstream software that MS has ever produced and get 10 official full commercial usable product keys, per product version. Though after three years or so they probably going to require payments, for renewed subscriptions (your keys will continue to work).
Post
Topic
Board Development & Technical Discussion
Re: Why not make Bitcoin more Secure with a PIN and TAN System?
by
Martin P. Hellwig
on 06/07/2011, 19:04:41 UTC
if you would be very secure, you would make a physical device with a small LCD screen, which prints out the addresses, and the amounts.
on that device the transaction will be signed. and the private key will never leave the device. this would be the only secure thing.

Hmmm, me thinking about those nfc enabled smartphones ...
Post
Topic
Board Wallet software
Re: Cross-client test data
by
Martin P. Hellwig
on 06/07/2011, 16:31:24 UTC
At the moment I am just parsing wireshark dumps for my protocol decoder, so I would be very interested in this too!
I can get a bit of a wiggle on with my python  stuff so you can at the protocol level decode it (well assuming I did it right), for decoding I more or imitated the look of a raw representation of blockexplorer. I am about 2 weeks away before I can release anything decent but I should be able to put something halfway working on within a couple of days, if anybody is interested.
Post
Topic
Board Bitcoin Discussion
Re: Ode to the protocol ...
by
Martin P. Hellwig
on 04/07/2011, 21:26:09 UTC
It would be nice if you could write notes about what you discover. AFAIK, the protocol is only partially documented and mostly resides in "oral tradition" (if I may say so – it's obviously not oral). You could e.g. contribute to the Protocol specification page on the wiki, that still has strong tying between the network protocol and the internal structure of the original implementation (see "variable length strings", data types all over the document, etc.).

I have a couple of goals set:
- Split out the protocol in a pure daemon part (which does the communication and storing of the blocks/transactions) possibly with an optional SQL back-end.
- Have everything PEP-8 and Python 3 compliant.
- Have unit tests  with a 100% coverage.
- Be able to have a local "blockexplorer" that does not depend on the c++ client but instead uses the code of the above daemon.
- Create a 'thin' CLI client that interacts with the daemon (in essence this will just hold the private keys and have some UI code).
- The same as above but a GUI client.

For me when coding, the most important part is readability and maintainability, this is also the reason why I am at try number 3  because the other tries, although successfully parsing the tcpdump of an interaction, was not readable enough. So ultimately I want my implementation to be working 'pseudo code'. As I have particular strong feelings on how the Protocol Specification should be written, I think that I am not the appropriate person to contribute to that page.

As the approach I am taking is painstakingly slow, I wouldn't hold my breath, though I do intend to release the source under the new revised BSD license.
And I am sure that when I at least have reached my 4th goal, I can be persuaded to (help) create a RFC with the intention to submit an Internet Draft to the IETF.
Post
Topic
Board Bitcoin Discussion
Ode to the protocol ...
by
Martin P. Hellwig
on 04/07/2011, 19:15:42 UTC
While I am quietly in my limited spare time building a python implementation of the bitcoin protocol I am increasingly charmed about the ingenuity of the protocol itself.
Sure in the beginning I had of a lot of things* that I found strange but what is even stranger is that I am continuously discovering that the choices made might not be pretty, or particular easy but they share one common trait so far; the alternatives have far worse implications**.

So I would like to take my hat off and say three cheers to everybody that is working, designing and building the protocol, the software and community!

Thank you, it is truly appreciated!

* )
1 The constant byteswapping. Well once (:-)) you have it subclassed  you hardly notice it anymore.
2 Only ~21 million BTC available? Yeah but it is easy enough to increase the divisibility
3 What about lost coins, can we not have a system in place where forgotten coins are available for reminig? Neat, but this ultimately leads for regular users to a dependency on an external service provider, which opens a whole other can of worms.
4 The use of secp256k1, Well ones you look into it, it is kinda neat and there is not a clear and obvious advantage to other curves or public key algorithm, so this falls in the category why not.
5 The lack of a python implementation. Well, I am working on it, so that one is my fault for not moving my behind faster :-)

** )
My opinion, thus the validity of the made statements are not universal.
Post
Topic
Board Development & Technical Discussion
Re: Transaction verification in Python (with M2Crypto)
by
Martin P. Hellwig
on 30/06/2011, 17:24:55 UTC

Sent, enjoy!
[/quote]

Thanks!
Post
Topic
Board Development & Technical Discussion
Re: Transaction verification in Python (with M2Crypto)
by
Martin P. Hellwig
on 29/06/2011, 20:56:36 UTC
12zhTAZg4R6DuV3TJpXTDE98ayFn9YL5qH

Most appreciated as I am not on exchanges and my laptop is a bit slow in mining :-)
Post
Topic
Board Development & Technical Discussion
Re: Transaction verification in Python (with M2Crypto)
by
Martin P. Hellwig
on 28/06/2011, 21:24:49 UTC
Hi,

Thanks for the snippet it is greatly appreciated!

My biggest problem was with M2Crypto: it doesn't seem to implement o2i_ECPublicKey from openssl, which is used by bitcoin to set the public key. I also looked at using pyOpenssl and pycrypto, but it looks like neither of these libraries can handle elliptic curve cryptography...

To make M2Crypto work for this I had to use some magic, which I'm really not happy about:
Code:
pkey = pubkey[::-1] + "0042030a0004812b050601023dce48862a070610305630".decode("hex")
pkey = M2Crypto.EC.pub_key_from_der(pkey[::-1])
As you can see, I need to add a fixed string in order to load the public key. Without this it fails to load it and I get an exception (ValueError: Received a NULL pointer.)
This string I got by making new public/private key pairs with M2Crypto and printing them out: I noticed that this part is fixed and never changes. I assume this string defines the parameters used (NID_secp256k)

Yes, that is correct, as you already figured out bitcoin only sends the xy position of the curve, however for openssl also needs to know which curve is used and of course what type of public key it is, since this is all DER encoded I opted for recreating the DER package. As you can see I used the same key to check if it works. Although in my code I only have a dependency on openssl directly (via subprocess) and thus do away with m2crypto or any other crypto wrapper, I do have a new dependency on pyasn1 http://sourceforge.net/projects/pyasn1/ though.

The relevant part of my code:
Code:
from pyasn1.codec.der import encoder
from pyasn1.type.univ import Sequence, ObjectIdentifier, BitString

# http://www.oid-info.com/get/1.2.840.10045.2.1
OID_EC_PUBLIC_KEY = "1.2.840.10045.2.1"
# http://www.oid-info.com/get/1.3.132.0.10
OID_SECP256K1 = "1.3.132.0.10"

def ec_public_key_in_der(xy_curve):
    "Create the DER public key part using the XY curve values"
    oid = Sequence()
    oid.setComponentByPosition(0, ObjectIdentifier(OID_EC_PUBLIC_KEY))
    oid.setComponentByPosition(1, ObjectIdentifier(OID_SECP256K1))
    
    xyc = BitString("'%s'H" % xy_curve.encode('hex'))
    
    tmp = Sequence()
    tmp.setComponentByPosition(0, oid)
    tmp.setComponentByPosition(1, xyc)
    return(encoder.encode(tmp))

if __name__ == '__main__':
    XY_CURVE = "0447d490561f396c8a9efc14486bc198884ba18379bcac2e0be2d8525134" +\
    "ab742f301a9aca36606e5d29aa238a9e2993003150423df6924563642d4afe9bf4fe28"
    XY_CURVE = XY_CURVE.decode('hex')
    
    PUBLIC_KEY = "3056301006072a8648ce3d020106052b8104000a0342000447d490561f" +\
    "396c8a9efc14486bc198884ba18379bcac2e0be2d8525134ab742f301a9aca36606e5d2" +\
    "9aa238a9e2993003150423df6924563642d4afe9bf4fe28"
    PUBLIC_KEY = PUBLIC_KEY.decode('hex')

    if ec_public_key_in_der(XY_CURVE) == PUBLIC_KEY:
        print(True)
    else:
        print(False)
Post
Topic
Board Bitcoin Discussion
Re: Shouldn't bitcoins be square?
by
Martin P. Hellwig
on 25/06/2011, 17:03:04 UTC
Not round? Just sayin'
 they are not round just look like it because they have an indefinitely amount of corners.
Post
Topic
Board Development & Technical Discussion
Re: [PAPER] 3-factor Authentication for Exchanges
by
Martin P. Hellwig
on 21/06/2011, 14:26:50 UTC
Hi,

The problem is an organizational one, if you don't trust the exchange in holding the money, the only logical alternative is that a user must make a manual effort to verify the transaction before it is processed. This more or less defeats the purpose of an exchange service that gets its added value because it can act on behalf of the user and large amount of transactions are automatically processed. Otherwise you end up with an ebay for bitcoins.

But perhaps I misunderstood your paper or exchanges in general.

Cheers,

Martin
Post
Topic
Board Development & Technical Discussion
Re: Wallet encryption
by
Martin P. Hellwig
on 18/06/2011, 02:05:40 UTC
I think the utility of wallet encryption in absence of a smartcard is very limited, if at all exists.
As the wallet is only needed when sending an transaction it is perfectly alright to encrypt it and prompt the user for a password to when needed.
Post
Topic
Board Development & Technical Discussion
Re: Semi-Related: How difficult is it to "hack into" a default ubuntu install?
by
Martin P. Hellwig
on 16/06/2011, 11:17:36 UTC
It has always perplexed me that the bitcoin core users seem to prefer ubuntu/debian over Redhat/Fedora/CentOS linux when they are supposedly "security conscious" elites of some sort ....

... industrial users who "need" security go the enterprise RH, Novell, suse linux direction not the other way ... just saying, seems weird.

*ahem* (FreeBSD user) ducks for cover, waiting for an OpenBSD user to reply.. :-)
Post
Topic
Board Development & Technical Discussion
Re: varint in client version 3210 not according to spec?
by
Martin P. Hellwig
on 15/06/2011, 11:45:47 UTC
Ah yes makes perfect sense. Thank you (both)