Skip to content

Instantly share code, notes, and snippets.

@ordishs
Created March 5, 2026 11:50
Show Gist options
  • Select an option

  • Save ordishs/62fadff3398231a5094a6d179c3b70da to your computer and use it in GitHub Desktop.

Select an option

Save ordishs/62fadff3398231a5094a6d179c3b70da to your computer and use it in GitHub Desktop.
Oracle settlement in Rúnar
public settle(outcomeType: bigint, rabinSig: RabinSig,
padding: ByteString, playerSig: Sig) {
// Verify the oracle attests to this outcome
const msg = num2bin(outcomeType, 8n);
assert(verifyRabinSig(msg, rabinSig, padding, this.oraclePubKey));
// Verify it's a win
assert(outcomeType == 1n);
// Player authorises the spend
assert(checkSig(playerSig, this.playerPubKey));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment