WeSearch

Keccak256 From Scratch in 200 Lines of Kotlin (Because Web3j Was 8 MB)

·2 min read · 0 reactions · 0 comments · 14 views
#kotlin#ethereum#crypto#android
Keccak256 From Scratch in 200 Lines of Kotlin (Because Web3j Was 8 MB)
⚡ TL;DR · AI summary

A developer created a lightweight implementation of the Ethereum hash function Keccak256 in Kotlin. This was done to avoid the large size of the Web3j library, which is over 8 MB, while the developer's APK is only 4.5 MB. The new implementation consists of 200 lines of code and has zero dependencies beyond what Android provides natively.

Key facts
Original article
DEV.to (Top)
Read full at DEV.to (Top) →
Opening excerpt (first ~120 words) tap to expand

try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3934022) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Alexandre Lasly Posted on May 19 Keccak256 From Scratch in 200 Lines of Kotlin (Because Web3j Was 8 MB) #kotlin #ethereum #crypto #android Web3j is 8 MB. My APK is 4.5 MB. So I wrote the Ethereum hash function from scratch. Why Not Just Import Web3j? I was building a native Ethereum wallet inside an Android Capacitor app. The goal: sign transactions without MetaMask, without WalletConnect, without any external app.

Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from DEV.to (Top)