Proof-of-work consensus by quantum sampling