Hashcash

แปลโดย : Claude 3 Opus (Pro)

Hashcash

[ANNOUNCE] hash cash postage implementation

On March 28, 1997, the now 2,000-or-so subscribers of the Cypherpunks mailing list received an announcement in their inbox. Sent by Adam Back, the email included a description and early implementation of what he described as “hashcash”: a “partial hash collision based postage scheme.” He had successfully designed a postage solution for email.

Like Dwork and Naor’s scheme, hashcash postage wouldn’t be paid to remailer operators, or the recipients of an email, or to anyone else for that matter. Instead, it would only add a cost for senders.

Back had considered solving spam by increasing the cost of bulk email in a different discussion on the mailing list about one week earlier—though only loosely: “A side benefit of using PGP, is that PGP encryption should add some overhead to the spammer—he can probably encrypt less messages per second than he can spam down a T3 link,” he commented in a discussion about adding more privacy to remailers.

Back’s new proposal made this general idea even more explicit: it would require that senders attach a proof of work to their emails. Indeed, hashcash was in several ways similar to Dwork and Naor’s postage scheme: the proof of work would be unique to the email, and it would require a little bit of processing power to produce.

As the name suggests, however, Back’s proposal was based on hashing.

Hashing—the cryptographic trick that turns any data into a unique and seemingly random string of numbers of a specific length—is a completely unpredictable process. Although the same data will result in the same hash every time, the only way to find out what the hash of a piece of data will look like in the first place, is to actually hash it. It’s this unpredictability that hashcash leveraged in a smart way.

To generate hashcash, a user had to generate a hash out of an e-mail’s metadata (the sender’s address, the recipient’s address, the time, etc.) and a random number—a nonce. But here’s the trick: not every resulting hash would be considered “valid.” Instead, the (binary version of) a valid hash had to start with a predetermined number of zeroes. And there would only be one way to generate a hash that starts with enough zeroes: the user would have to try different nonces and create new hashes until he’d find one that happened to meet the threshold. Simple trial and error.

The amount of leading zeroes required would determine how difficult it’d be to find a valid hash. More zeroes would make it more difficult, because computers would on average need to make more guesses.

“The idea of using partial hashes is that they can be made arbitrarily expensive to compute,” Back explained the advantage of using hashes, “and yet can be verified instantly.”

Like Dwork and Naor’s solution, the idea was that regular users shouldn’t have a problem finding a valid hash to send along with an email fairly quickly—within a few seconds—but spammers shouldn’t be able to do it thousands or millions of times and still remain profitable.

“[. . .] if it hasn't got a 20 bit hash [. . .] you have a program which bounces it with a notice explaining the required postage, and where to obtain software from,” Back explained on the Cypherpunks mailing list. “This would put spammers out of business overnight, as 1,000,000 x 20 = 100 MIP years which is going to be more compute than they've got.”

A subtle difference from Dwork and Naor’s solution was that their proof-of-work system wasn’t subject to randomness. The duo’s postage scheme essentially required solving a rather straightforward puzzle, which meant that a more powerful computer would solve the puzzle faster than a weaker computer every time.

Producing a valid hash, on the other hand, is a guessing game. And while a more powerful computer would be able to make more guesses per second, a weaker computer could still get lucky from time to time and find a valid hash faster. (Though since spammers would have to generate thousands or millions of valid hashes per spam session anyway, the little bit of variance involved with generating a single hashcash proof of work wouldn’t make a meaningful difference—at least not in the context of stopping junk mail.)

“Hashcash may provide a stop gap measure until digicash becomes more widely used,” Back concluded his announcement. “Hashcash is free, all you've got to do is burn some cycles on your PC. It is in keeping with net culture of free discourse, where the financially challenged can duke it out with millionaires, retired government officials, etc on equal terms.”

And:

“Hashcash may provide us with a fall back method for controlling spam if digicash goes sour (gets outlawed or required to escrow user identities).”

แฮชแคช

[ประกาศ] การใช้งานค่าไปรษณียากร hash cash

เมื่อวันที่ 28 มีนาคม 1997 สมาชิกราว 2,000 คนของเมลลิ่งลิสต์ Cypherpunks ได้รับประกาศในกล่องจดหมายของตน ส่งโดย Adam Back อีเมลนี้มีคำอธิบายและการใช้งานในระยะแรกของสิ่งที่เขาเรียกว่า "hashcash": "แผนการค่าไปรษณียากรตามการชนกันบางส่วนของแฮช" เขาออกแบบโซลูชันค่าไปรษณียากรสำหรับอีเมลได้สำเร็จ

เหมือนกับแผนการของ Dwork และ Naor ค่าไปรษณียากร hashcash จะไม่จ่ายให้กับผู้ดำเนินการ remailer หรือผู้รับอีเมล หรือใครก็ตามที่เกี่ยวข้อง แต่จะเป็นการเพิ่มต้นทุนให้กับผู้ส่งเท่านั้น

Back เคยพิจารณาแก้ปัญหาสแปมโดยการเพิ่มต้นทุนของการส่งอีเมลจำนวนมากในการอภิปรายที่แตกต่างออกไปบนเมลลิ่งลิสต์เมื่อราวหนึ่งสัปดาห์ก่อนหน้านั้น แม้จะค่อนข้างคลุมเครือ: "ประโยชน์เสริมของการใช้ PGP คือ การเข้ารหัส PGP ควรเพิ่มภาระแก่ผู้ส่งสแปม เขาอาจเข้ารหัสข้อความได้น้อยกว่าจำนวนข้อความที่เขาสามารถส่งสแปมผ่านลิงก์ T3 ได้ต่อวินาที" เขาแสดงความคิดเห็นในการอภิปรายเกี่ยวกับการเพิ่มความเป็นส่วนตัวให้กับ remailer

ข้อเสนอใหม่ของ Back ทำให้ความคิดทั่วไปนี้ชัดเจนยิ่งขึ้น: มันจะกำหนดให้ผู้ส่งแนบหลักฐานการทำงานไปกับอีเมลของพวกเขา แท้จริงแล้ว hashcash มีหลายส่วนที่คล้ายกับแผนการค่าไปรษณียากรของ Dwork และ Naor: หลักฐานการทำงานจะเป็นเอกลักษณ์เฉพาะอีเมล และจะต้องใช้พลังประมวลผลเล็กน้อยในการผลิต

อย่างไรก็ตาม ตามที่ชื่อบ่งชี้ ข้อเสนอของ Back นั้นอิงกับการแฮช

การแฮช เทคนิคการเข้ารหัสลับที่เปลี่ยนข้อมูลใดๆ ให้เป็นสตริงตัวเลขที่ไม่ซ้ำและดูเหมือนสุ่มด้วยความยาวเฉพาะ เป็นกระบวนการที่ไม่สามารถคาดเดาได้เลย แม้ว่าข้อมูลชุดเดียวกันจะให้ผลแฮชเดียวกันทุกครั้ง แต่วิธีเดียวที่จะรู้ว่าแฮชของข้อมูลจะมีหน้าตาเป็นอย่างไรตั้งแต่แรก คือการแฮชข้อมูลนั้นจริงๆ ความไม่สามารถคาดเดาได้นี้เองที่ hashcash ใช้ประโยชน์อย่างชาญฉลาด

ในการสร้าง hashcash ผู้ใช้ต้องสร้างแฮชจากเมตาดาต้าของอีเมล (ที่อยู่ผู้ส่ง ที่อยู่ผู้รับ เวลา ฯลฯ) และตัวเลขแบบสุ่ม (nonce) แต่นี่คือกลเม็ด: ไม่ใช่ทุกแฮชที่ได้จะถือว่า "ถูกต้อง" แต่ (เวอร์ชันไบนารีของ) แฮชที่ถูกต้องจะต้องขึ้นต้นด้วยเลขศูนย์จำนวนที่กำหนดไว้ล่วงหน้า และจะมีวิธีเดียวในการสร้างแฮชที่ขึ้นต้นด้วยเลขศูนย์มากพอ: ผู้ใช้จะต้องลองใช้ nonce ที่แตกต่างกันและสร้างแฮชใหม่จนกว่าจะพบแฮชที่บังเอิญผ่านเกณฑ์ การลองผิดลองถูกอย่างง่าย

จำนวนเลขศูนย์นำหน้าที่ต้องการจะเป็นตัวกำหนดว่าจะยากแค่ไหนในการหาแฮชที่ถูกต้อง ยิ่งมีเลขศูนย์มากเท่าไหร่ ก็จะยากขึ้นเท่านั้น เพราะคอมพิวเตอร์จะต้องใช้การเดาโดยเฉลี่ยมากขึ้น

"ความคิดของการใช้แฮชบางส่วนคือ สามารถทำให้มีราคาแพงในการคำนวณได้ตามต้องการ" Back อธิบายข้อดีของการใช้แฮช "และยังสามารถตรวจสอบได้ในทันที"

เช่นเดียวกับโซลูชันของ Dwork และ Naor ความคิดคือผู้ใช้ปกติไม่ควรมีปัญหาในการหาแฮชที่ถูกต้องเพื่อส่งพร้อมกับอีเมลได้อย่างรวดเร็ว ภายในไม่กี่วินาที แต่สแปมเมอร์ไม่ควรสามารถทำได้หลายพันหรือหลายล้านครั้งและยังคงทำกำไรได้

"[. . .] ถ้าไม่มีแฮช 20 บิต [. . .] คุณมีโปรแกรมที่จะดีดกลับพร้อมประกาศอธิบายค่าไปรษณียากรที่ต้องการและจะไปรับซอฟต์แวร์ได้จากที่ไหน" Back อธิบายบนเมลลิ่งลิสต์ Cypherpunks "สิ่งนี้จะทำให้สแปมเมอร์ต้องปิดกิจการภายในข้ามคืน เพราะ 1,000,000 x 20 = 100 ล้าน MIP ต่อปี ซึ่งจะเป็นการคำนวณมากกว่าที่พวกเขามี"

ความแตกต่างเล็กน้อยจากโซลูชันของ Dwork และ Naor คือ ระบบพิสูจน์งานของพวกเขาไม่ขึ้นอยู่กับความสุ่ม แผนการค่าไปรษณียากรของทั้งคู่ต้องการให้แก้ปริศนาที่ค่อนข้างตรงไปตรงมา ซึ่งหมายความว่าคอมพิวเตอร์ที่ทรงพลังกว่าจะแก้ปริศนาได้เร็วกว่าคอมพิวเตอร์ที่อ่อนแอกว่าทุกครั้ง

ในทางกลับกัน การสร้างแฮชที่ถูกต้องเป็นเกมทายใจ และแม้ว่าคอมพิวเตอร์ที่ทรงพลังกว่าจะสามารถเดาได้มากกว่าต่อวินาที แต่คอมพิวเตอร์ที่อ่อนแอกว่าก็ยังโชคดีเป็นครั้งคราวและพบแฮชที่ถูกต้องได้เร็วกว่า (แต่เนื่องจากสแปมเมอร์จะต้องสร้างแฮชที่ถูกต้องนับพันหรือนับล้านต่อรอบการสแปมอยู่แล้ว ความแปรปรวนเล็กน้อยที่เกี่ยวข้องกับการสร้างหลักฐานการทำงาน hashcash เดียวจะไม่ทำให้เกิดความแตกต่างอย่างมีนัยสำคัญ อย่างน้อยก็ไม่ใช่ในบริบทของการหยุดจดหมายขยะ)

"Hashcash อาจเป็นมาตรการชั่วคราวจนกว่าเงินดิจิทัลจะใช้กันอย่างแพร่หลายมากขึ้น" Back สรุปการประกาศของเขา "Hashcash นั้นฟรี สิ่งที่คุณต้องทำคือเผารอบการทำงานบน PC ของคุณ มันสอดคล้องกับวัฒนธรรมเน็ตแห่งการสนทนาอย่างอิสระ ที่ผู้มีปัญหาทางการเงินสามารถต่อสู้กับเศรษฐี ข้าราชการเกษียณ ฯลฯ บนเงื่อนไขที่เท่าเทียมกัน"

และ:

"Hashcash อาจให้วิธีการสำรองสำหรับควบคุมสแปมกับเรา หากเงินดิจิทัลมีปัญหา (ถูกห้ามหรือต้องเก็บข้อมูลประจำตัวผู้ใช้)"

Last updated