Skip to content

Instantly share code, notes, and snippets.

View cgcardona's full-sized avatar
💭
🤖

Gabriel Cardona cgcardona

💭
🤖
View GitHub Profile
@KarolTrzeszczkowski
KarolTrzeszczkowski / p2sh notification protocol.md
Last active August 9, 2022 01:11
Description of p2sh notification protocol

Abstract

The p2sh notification protocol is to pin the p2sh address to the wallets of contract participants and provide aditional informations that will help participants deduce what contract is it.

Motivation

The main motivation of this protocol is to make p2sh smart contracts recoverable from the seed. Some smart contracts, like Licho Last Will or Moser-Eyal-Sirrer vault may be used for long term storage of savings. In this case it is desirable to have a way to reconstruct the contract address just from the seed.

Specification

p2sh notification message is a transaction with 1 OP_RETURN output and as many p2pkh dust outputs as the number of participants of the contract and possibly a change output.

The OP_RETURN output consists of:

@dcousens
dcousens / _scripttemplates.md
Last active February 3, 2024 18:59
Transaction / Script Templates
  • <> represents data or script
  • {} represents data that must prefixed by OP_PUSHDATA
  • [] represents multiple {}

Standard Scripts

PubKey (pay-to-pubkey / P2PK)

Address: N/A
scriptPubKey: {pubKey} OP_CHECKSIG