Skip to content
Kriptofoni
Crypto GlossaryDeveloper Tools

What Is Push vs Pull Model?

Also known as: Push and Pull Model, Push Oracle, Pull Oracle, Push vs Pull

In short

The push vs pull model is the design distinction in blockchain applications between an approach in which data or payment is delivered automatically by the sender to the recipient (push) and one in which the recipient requests it when needed (pull).

The distinction is seen most in oracles. In the push model, the oracle network writes price data on-chain itself at set intervals or when the price crosses a certain threshold; Chainlink's classic price feeds use this approach. Applications read the data waiting ready on-chain, but the gas cost of updates is paid continuously. In the pull model, signed price data is published off-chain and the user brings this up-to-date data on-chain by including it in their transaction at the moment they transact; Pyth Network is a well-known example of this model.

The push model offers simplicity and constant availability, but data can go stale between updates. The pull model allows more frequent and cheaper updates, but the responsibility for bringing the up-to-date data shifts to the application or the user.

The same distinction is also used for payments in smart contracts. In the 'pull over push' pattern recommended in Solidity, instead of sending payments to recipients itself in a loop, the contract records each recipient's balance owed and waits for recipients to withdraw their funds themselves. This approach prevents a single failed transfer from locking up the entire transaction and narrows the attack surface for attacks such as reentrancy.

Last updated: · This content is for information purposes only and is not investment advice.

Related terms