Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save ordishs/a2e0ba58cbd4e9d84d5b27c89076c637 to your computer and use it in GitHub Desktop.
P2PKH in Rúnar Solidity-like
pragma runar ^0.1.0;
contract P2PKH is SmartContract {
Addr immutable pubKeyHash;
constructor(Addr _pubKeyHash) {
pubKeyHash = _pubKeyHash;
}
function unlock(Sig sig, PubKey pubKey) public {
require(hash160(pubKey) == pubKeyHash);
require(checkSig(sig, pubKey));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment