This might seem somewhat confused because I'm working with a very poor memory here... you might find some of this is clarified/corrected in time:
Auctions were held in the docks area of Bristol and, upon a sale, the auctioneer would bring the hammer down on an iron pillar (capstan?). This was named "the nail" locally and if your got what you were bidding for people would say "you hit the nail on the head".
Well, that's something like it!