That's not how it works. First to file means that, given that two claimants of a patent, the first to file will get it. It does away with a messy process that incentivized holding on to trade secrets and delaying filing a patent as long as possible. First to invent can get incredibly messy and expensive to prove. Before some reform years ago, there was a practice known as submarine patents where applications would be submitted and withdrawn indefinitely, effectively allowing extended patent protection without disclosure.
If prior art is out there, the patent is invalid anyway in both cases. Quoth Wikipedia:
"Prior art (also known as state of the art, which also has other meanings, or background art[1]), in most systems of patent law,[2] constitutes all information that has been made available to the public in any form before a given date that might be relevant to a patent's claims of originality. If an invention has been described in the prior art, a patent on that invention is not valid."
Sure, maybe they'll get the patent. If it's the same as Bitcoin, it would be invalidated. First to invent vs. first to file doesn't really come into play here because no one else is trying to patent it.