Created
March 5, 2026 11:50
-
-
Save ordishs/62fadff3398231a5094a6d179c3b70da to your computer and use it in GitHub Desktop.
Oracle settlement in Rúnar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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