Using the JVM as a platform for smart contracts & cryptocurrency
summary
Argues the JVM can host provably deterministic smart contracts by rejecting or rewriting unsafe bytecode at classload time, using a custom whitelist classloader and ASM to inspect and transform class files, banning threads, natives, System.currentTimeMillis, catches of ThreadDeath and syncing, and enforcing strictfp. Inserts runtime cost checks (allocation, jump and invocation thresholds) so misbehaving contracts are killed and rolled back. Demonstrates a one-thread-per-contract sandbox (a demo container called GreyMorin) that successfully loads deterministic classes and rejects nondeterministic ones for R3’s Corda.
AI-written summary · about
chapters (14)
- 0:00Introduction to crypto
- 2:50Defining digital cash
- 6:36Bitcoin and trustlessness
- 8:28Smart contract challenges
- 11:33The JVM as a platform
- 15:59Determinism and the JVM
- 19:10Bytecode fundamentals
- 21:53Bytecode and security
- 26:35Object lifecycle
- 31:01Class loading mechanism
- 36:28Implementing custom loaders
- 39:43Deterministic execution
- 43:34Implementation and demo
- 50:55Q&A and conclusion
