Skip to content

Instantly share code, notes, and snippets.

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

  • Save ordishs/76ffb60d7a67dfd45954859dd39012cf to your computer and use it in GitHub Desktop.

Select an option

Save ordishs/76ffb60d7a67dfd45954859dd39012cf to your computer and use it in GitHub Desktop.
P2PKH in Rúnar TypeScript
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