Skip to content

Instantly share code, notes, and snippets.

@pool2win
Created August 25, 2023 08:04
Show Gist options
  • Save pool2win/3c596ad7d9ed531d51652a2846e702ff to your computer and use it in GitHub Desktop.
Save pool2win/3c596ad7d9ed531d51652a2846e702ff to your computer and use it in GitHub Desktop.
Demo lisp for bitcoin miniscrpit
#lang racket
;; define place holder functions for demo
(define (pk key) (eq? key #t))
(define (older num) (> num 1000))
(define (hash160 val) (val))
(let ([key_revocation 'abc]
[key_local 'def]
[key_remote 'xyz]
[H 100])
;; to_local policy
(or (pk key_revocation)
(and (pk key_local) (older 1008)))
;; offered HTLC policy
(or (pk key_revocation)
(and (pk key_remote)
(or (pk key_local)
(hash160(H))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment