Created
March 5, 2026 11:50
-
-
Save ordishs/76ffb60d7a67dfd45954859dd39012cf to your computer and use it in GitHub Desktop.
P2PKH in Rúnar TypeScript
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
| class P2PKH extends SmartContract { | |
| readonly pubKeyHash: Addr; | |
| constructor(pubKeyHash: Addr) { | |
| super(pubKeyHash); | |
| this.pubKeyHash = pubKeyHash; | |
| } | |
| public unlock(sig: Sig, pubKey: PubKey) { | |
| assert(hash160(pubKey) === this.pubKeyHash); | |
| assert(checkSig(sig, pubKey)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment