Skip to content

Creating A Simple pay-to-script app#

You can make some simple apps with just the node and ErgoScript using the P2S address compiler available at Sending a transaction to this P2S address creates an output locked with the script


P2S vs P2SH#

Typically most people use P2S because it is a lot easier to use. P2SH means you have to keep the contract ready off-chain to be submitted when you create the transaction, and if you lose it, then your funds are stuck forever. This also makes it harder for other people to use your dApp as they need the contract themselves, rather than just the address. P2SH is technically cheaper since you store less data on-chain, but likely we won't see anyone using P2SH until we start to get heavy load on-chain.