Skip to content

Instantly share code, notes, and snippets.

The Three Implementation Properties

There are three properties an implementation might attempt to hold, detailed below. With Opaque Handoffs, they form a trilema (pick two of three) and trivially allow for E-Order. With Transparent Handoffs, you can get all three, but lose E-order. E-order can be re-established with the WormholeOp.

Handoff Transparency

Handoffs have a register side (OCapN: bootstrap method "deposit-gift") and a two-message redeem side (OCapN: record "desc:handoff-give" and bootstrap method "withdraw-gift").

For Opaque Handoffs, the Receiver and the Exporter cannot see what Reference is being handed off from the redeem side alone. Therefore, Handoff cannot resolve until after the register and redeem messages have been seen by the exporter.

TLDR

I took a deep dive into CapnWeb. What I expected to find was a browser-first Cap'n Proto successor with rigid schemas replaced by flexibile JSON-compatible data structures. What I found instead was a pared-down pairwise protocol with an interesting expression format.

OCapN on the otherhand has the three-way protcol interactions with a flexible data model with object reference stability.

Comparing OCapN and CapnWeb

@kumavis
kumavis / test.scm
Created May 5, 2025 10:16
attempt to demonstrate desc:answer lacks an inverse representation in OCapN
(define-values (a-vat a-netlayer a-mycapn)
(make-new-node "a"))
(define-values (b-vat b-netlayer b-mycapn)
(make-new-node "b"))
(define (^greeter _bcom our-name)
(lambda (their-name)
(format #f "Hello ~a, my name is ~a" their-name our-name)))
(define (^echo _bcom)
@kumavis
kumavis / readme.md
Last active May 4, 2025 10:36
OCapN concepts
@kumavis
kumavis / lazy-promise.js
Last active May 4, 2025 01:29
LazyPromise
/**
* A LazyPromise doesn't run its executor until .then, .catch, or .finally is called,
* or the promise is awaited.
* Unfortunately, `@endo/promise-kit`'s isPromise returns false for instances of LazyPromise.
* However, LazyPromise instances will return true for instanceof Promise.
*/
export class LazyPromise extends Promise {
#isListening = false;
#executor;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
.
.
,d88b, . __..-
888888 . .--SEAL:.
`?88P' . __ ,'WWII::.
.MW:`-. /WWII::..
. _.MWII:'. `. . ,'WII::..
_.-MWII::'. `-. ,'WWI::.
. _..vvvv,'WWII::' `.'WII::.
,-'WI:'''/WII:'. \WI:.
@kumavis
kumavis / index.js
Created February 8, 2021 06:57
mini-moat
#!/usr/bin/env node
const { promisify } = require('util')
const sass = require('sass')
const { promises: fs } = require('fs')
const vm = require('vm')
// example()
// async function example(){
// const vmContext = vm.createContext()
@kumavis
kumavis / gist:ab0e6ab555362c5e479d6311c4540bbd
Created November 30, 2020 09:36
go-ethreum mainnet fast sync performance on digital ocean
syncing geth on digital ocean
- name: eth2-mainnet-00
- sync time: (failed to sync, bound by disk perf)
- region: fra1
- type: s-8vcpu-16gb
- primaryDb: attached volume
- ancientDb: attached volume
- price vps: $0.119/hr
- price volume: $0.052/hr 350gb
https://www.redfin.com/OR/Portland/6109-SW-Thomas-St-97221/home/173018992?utm_source=android_share&utm_medium=share&utm_nooverride=1&utm_content=link
https://www.redfin.com/OR/Portland/3246-SW-Cascade-Ter-97205/home/26369492?utm_source=android_share&utm_medium=share&utm_nooverride=1&utm_content=link