SourceHut 宣佈拒絕 cryptocurrency 與 blockchain 相關的專案

SourceHut 是個 GitMercurial 的 hosting service,以及提供一些專案管理常見的功能。

他們宣佈不再提供 cryptocurrency 以及 blockchain 相關專案的服務,自 2023 年生效:「SourceHut terms of service updates, cryptocurrency-related projects to be removed」。

SourceHut is planning to roll out updates to our terms of service, effective in 2023. The changes most likely to impact users is the prohibition of cryptocurrency- or blockchain-related projects on SourceHut.

因為這些技術幾乎都是用在違法用途上:

These domains are strongly associated with fraudulent activities and high-risk investments which take advantage of people who are suffering from economic hardship and growing global wealth inequality. Few to no legitimate use-cases for this technology have been found; instead it is mostly used for fraudulent “get rich quick” schemes and to facilitate criminal activity, such as ransomware, illicit trade, and sanctions evasion. These projects often encourage large-scale energy waste and electronics waste, which contributes to the declining health of Earth’s environment. The presence of these projects on SourceHut exposes new victims to these scams and is harmful to the reputation of SourceHut and its community.

不過這年頭自己架 GitLab 也不是什麼難事,該有的功能都有,這個只能算是個宣言...

即使你不開營利,YouTube 也開始會顯示廣告了...

在「YouTube Will Now Show Ads On All Videos Even If Creators Don’t Want Them」這邊看到的消息,YouTube 現在會針對非營利的影片也開始放廣告了,而且不會分潤給創作者:

看到新聞當下馬上想到的是「NiceChord 好和弦」這個完全不開平台廣告的頻道,然後剛剛就看到他貼出來:(出自 https://www.facebook.com/nicechord/posts/2800689726883136 這邊,Facebook 的 embed 太麻煩了...)

他挑的是 LBRY 這個架構的平台,不過記得 LBRY 平台的頻寬部份需要自己打理,這點 lbry.tv 是有弄一組出來 (cdn.lbryplayer.xyz),但對於台灣這邊的連線品質就不太行... 不過這讓我想把 cdn.lbryplayer.xyz 放進 SmokePing 裡面監控看看。

不過就算自己要處理頻寬成本應該也還好,馬上想的到的方法是 Backblaze + Cloudflare 這種方式,不過我記得 Cloudflare 很明顯很不歡迎這種用法,量大的 YouTuber 切過去的瞬間大概就會被處理 XD

如果考慮自己付錢,像是 EGI Hosting 的美國頻寬對台港區還算堪用,Bare Metal Server Plans 這邊有看到 USD$60/month 提供 20TB/month 的頻寬,大約是 USD$0.003/GB。

更低的像是 OVH 的「Dedicated server prices - Discover our solutions | OVHcloud」,500Mbps 也差不多是 USD$60/month,只算 1/3 使用率的話大約是 50TB,成本會降到 USD$0.0012/GB

不過 LBRY 更大的問題是他還搞了 blockchain 出來,這滿滿 (逼~) 的味道,到底做不做的起來就不曉得了 XDDD

Blockchain 的使用時機

這兩則可以一起看,首先是 Jimmy Wales 對於提議用 blockchain 記錄維基百科的回應:

另外一個是 xkcd 最近的酸圖:

腦袋裡又瞬間冒出「詐騙集團」這個詞彙 XDDD

Ethereum Smart Contracts 裡的 PRNG

現代密碼學的安全性有很大一塊是基於亂數產生器 (RNG) 非常難被預測。如果這個前提不成立的話,利用亂數產生器產生出來的各種資訊都會被預測出來 (尤其是 Private Key)。

但真正的 RNG 需要靠硬體支援,而且產生速度很慢,一般都會使用 PRNG (Pseudorandom number generator) 產生。也就是「看起來」很亂的亂數產生器。

PRNG 通常是指在統計學上通過許多測試,像是在多種測試都是 Discrete uniform distribution,不需要防止有惡意人,可以從產生出的 PRNG 的值而推導出後續結果的用途。

在「Predicting Random Numbers in Ethereum Smart Contracts」這篇裡面,作者列出了一堆實做 Ethereum Smart Contracts 卻誤用 PRNG 的行為。

文章裡提到的問題都是因為 PRNG 拿著可被預測的資訊當作 entropy source (e.g. seed),而且提出來的範例都是拿 block 本身或衍生的資訊 (像是 block 的 hash) 來用:

  • PRNGs using block variables as a source of entropy
  • PRNGs based on a blockhash of some past block
  • PRNGs based on a blockhash of a past block combined with a seed deemed private
  • PRNGs prone to front-running

然後列了大量的程式碼當例子,建議有需要接觸的人看過一次,或是有時間的人都值得看這些負面範例... XDDD

不過作者在文章裡面也給了一堆有問題的方法,像是從外部網站取得亂數之類的 XDDD

正確的方法是使用 CSPRNG (Cryptographically secure pseudorandom number generator),這是專門設計給密碼學用的 PRNG。

CSPRNG 有幾種方法可以取得:

  • 在大多數的程式語言內都有對應的 library 可以用,另外在比較近代的瀏覽器內 (如果問 IE 的話,是 11+),可以透過 RandomSource.getRandomValues() 得到。
  • 如果打算自己搞底層而需要直接取得 CSPRNG 的產出,在 Unix-like 的環境下可以透過 /dev/urandom 取得,在 Microsoft Windows 下則可以透過 CryptGenRandom 取得。

別學作者那邊奇怪方法啊 XDDD

分散式的論壇系統

在「Kudos - A Peer-to-Peer Discussion System Based on Social Voting」這邊看到分散式的論壇系統,帶有投票分數機制以及相關議題機制:

Decentralized Reddit using a DHT to store content and a blockchain to rank such content. Whitepaper with more details here: http://lucaa.org/docs/kudos.pdf

論文裡面可以看出來設計的觀念受到 Bitcoin 的啟發,演算法也是... 換句話說,Bitcoin 帶來的影響遠遠超過金融市場,Bitcoin 所使用的理論也給其他領域很多想法。

如果這樣的系統可行的話 (還沒仔細研究 @_@),真正分散式的論壇系統就會出現了...