I've looked at and read a bunch of different Prolog books. In my opinion the best one is `Programming in Prolog: Using the ISO Standard' by Clocksin & Mellish. It's actually one of my favorite programming books. Do all the exercises!
I find it troublesome that some of the code in BitMessage seems to be taken directly from Stackoverflow.com responses (it actually reminds me a lot of what I see happening at school). With that being said -- I do appreciate that this is new and can be improved upon quickly by a community of people with interest in such a system.