Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save ordishs/6751f3eee75d7878e022693b2afb6b55 to your computer and use it in GitHub Desktop.
P2PKH in Rúnar Go
type P2PKH struct {
runar.SmartContract
PubKeyHash runar.Addr `runar:"readonly"`
}
func (c *P2PKH) Unlock(sig runar.Sig, pubKey runar.PubKey) {
runar.Assert(runar.Hash160(pubKey) == c.PubKeyHash)
runar.Assert(runar.CheckSig(sig, pubKey))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment