Published on

New block webhooks

Authors
Monetize your wallet transactions today.
👋 Welcome to our Engineering blog. merkle specializes in MEV protection and monetization on Ethereum. We guarantee minimum $0.08 per transaction. Ideal for Wallets and RPC Providers looking to protect their customers against Sandwiches while generating revenue.

We're excited to announce the launch of Block Webhooks, the easiest way to get notified about new blocks. At merkle, we have a few products that need to be constantly following the chain. For a while we were using websocket connections, but they are flaky and prone to error, especially when implemented multiple times, in different product, using different programming languages.

Why use webhooks?

webhook ui

Webhooks are a great way to get notified about new blocks. They are easy to implement, and they are reliable. We took our expertise in following the chain, handling re-orgs and other edge cases, and built a service that can be used by anyone.

merkle will notify you if any webhook starts failing, and will automatically retry failed requests up to 3 times.

How to use webhooks?

Head over to our Merkle Blockchain Services (MBS) platform where all our products are hosted. You can create a free account and start using webhooks right away. You can create up to 10 webhooks for free.

webhook ui

Simply select the network and the url you'd like to be notified at. MBS will send a POST request to your url every time a new block is mined. A secret is also sent in the request body, which you can use to verify the request came from MBS.

The blocks received from webhooks follow the exact same schema as the eth_getBlockByNumber RPC request, making it easy to parse into familiar libraries such as viem or ethers:

{
  "baseFeePerGas": "0x46bb64ce2",
  "difficulty": "0x0",
  "extraData": "0x7273796e632d6275696c6465722e78797a",
  "gasLimit": "0x1c9c380",
  "gasUsed": "0x84d5c5",
  "hash": "0x69352796c588eb5dc1a539022abd55c2f6506f0f53d9d5aa9153d716eb6fda33",
  "logsBloom": "0x042b151e7393d509122a1a0cbb22c8203515809241110113119300d764760d012a009121a2014a00423a9b48001a29009e2101079b072ada14158506007928a1e684820c5c51f9ee6c16408d02a46aa28493108c09454ed049a31445886dec2d728140148322510e142c19145000286d12130864829d2c4a9cba04ddad6a15328400825480a5002984c588482d024ce6080b04834d89606ceeb30ce43e3a500bbb50095716ea6825c6315ac9b9cb06140464574010048a464c618428059806c098d0208a080f50c9c505b213493c50110074b212f5217c540e6e70022851e24a0030b648a08c9c4883c412a10add0824860c92105b0830584288fa17415a5693",
  "miner": "0x77777a6c097a1ce65c61a96a49bd1100f660ec94",
  "mixHash": "0x1d767cb5d7135f172283caaadce7c8f7ed18d17325c642fa6189371182acbd4e",
  "nonce": "0x0000000000000000",
  "number": "0x122e765",
  "parentHash": "0x9d7191134bf3af671fa6b545f80cc5802d241b36cce5ebbc3d9f3f56319599cd",
  "receiptsRoot": "0x5e3ac1014e216ead6b2b1a0fa36a34ed57dd8b73466185e7c61896898e3dd02c",
  "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  "size": "0xcc87",
  "stateRoot": "0xfc78d677ed922bc36bf437e124fb79bfebf5642ec8857cf7d4d9e455c850528c",
  "timestamp": "0x65aed20f",
  "totalDifficulty": "0xc70d815d562d3cfa955",
  "transactions": [
    "0x99ea3c6a21c9252102f82a5f0f709cc1602363bd9394a98703e241ea933040fc",
    "0xfe44b0a4be243a257d43252ac86ed8505a03fe2f4fed9d078f834a955205e93d",
    "0xef7769d41b41252fed1a44ff92de5f3e249c3a2ef9bad2d15c96814d06db2d14",
    "0x4a137e67764ae34b57ae6e431224329f3b7961d1febae8e7854401f59e323fee",
    "0x63ec8929d343537bd6015a4424f3e3f1266e079b7e69b514af455d096d931e97",
    "0xdb3729217f7c13f3bfd2745baf4ef3f8e8845f290cdbbca5c5dca33bf3ed3730",
    "0x57a4736ef1990a1901a28027a2de8fd2ec6301310aa9c6594a5cdee124fc7813",
    "0xc90c7e206fa704fe7460c99f609443ecd31da77d8c47b3e0c0a60fa72d4549de",
    "0xfcf92b28e2c3b397a4eb8976d6d4a57f10219a3f87116742481478c5f3a89a24",
    "0x28d16e4753b1a32ca41c43a0beb0188d01abd2eb2382ca7f26d0765cc68fc44f",
    "0x1cc2e90ced369630c69a1dadb9a9466226a673cd7ed1272f389a14af231488f3",
    "0xbf566c2528958744bcd23ced347f1a8c0fd61ebfc91a61e950959731c5e70670",
    "0x70979d6c290d4a21267e75b7f76a91b49c5cf8f85cb4f5a7b83a667c29180c64",
    "0xc41eadcc2c73c80b6e1626829447bac00a688a2685c10818ff502417cd6b3a35",
    "0x332892d78ee5b3f2ffdaa33a51858450aba9a4d400fd1242d95a8581dde4939a",
    "0xbb78a0f5d36f4b1fc0a3b601e3520dd4ea68773d933583a9be80819240bb0f32",
    "0x6a8845960cb148d9d8396da1609ce37a227b09d2e34df805916ba05a956b0684",
    "0xe7c5e621a39d5aa03dcb359499c50bba2c31fd9691128e62495b0902971796ab",
    "0x6808958a3d12b39778ef36f359fd12faee3b61b23f0c2b92fc90bfb766ab9195",
    "0x4b6af3b6c02de82c59d452194e562c7be2fe62faf221d6a122ddd84394581a0a",
    "0x80de36a3904af9eff72cc622b17e1804f50deb1f60d86613463b1aec38c9eb78",
    "0xab2f32d91773a1f98cfe897b0d53901c780a7c08f218ecbd792558ef3683afe8",
    "0x0a297ba30ad96199549d7fd8ac6092eb194a54156174122b291930bbab407d25",
    "0xfcb3c89ff41d38fa6c37d5e2c81d042c7432d872cecf315fb862d9e535170cda",
    "0xf922f17b590fbf8c55c9e8647fa5264e00de495112979b24c514fc5d0e0b089e",
    "0x1935d8fd818b56c701cb035b5f11eef2b819f185022b97a384d9c51a59481df8",
    "0xefc09a0a3e0d6253bbc6bce9da2cfa3520511de371c313b604dfdacac4fb458a",
    "0x0f06e9f96a3f9d6e3802cd4d83f5b2b2927161a42e5ea098b00b8cda55b7eb48",
    "0xd5f4a9b0b0b1a2f34c20050be5f10cc2614f5592ee942de69c1734f4905a1ead",
    "0x276e0020bed08a4a12e74cf7e13a57d231147fd88f41d03fe853973c6daaad53",
    "0xc97131d6fc46c0f90bcab59ba570d43aef06b2e1154fbc07910d07c869ac9df0",
    "0x29ed3acea601aabfa7a46db39dd3dfcd7c1cfa7ce8bf50e592a4832b3036dcdd",
    "0x49af017a107957ee1dff003a6d81cb9028c0fc9e28c2b08937af803ca2178f8b",
    "0xdab98f38b43e959845c2607bfca2fa53e4c0fc8f6ef1edaa54d982ee22f64bae",
    "0xfb24bc2ad7b4f4f138df067f52077ec71c41cdbbad8b8527ecaa69e9f5e5d47f",
    "0x944e55009257104eafe0fbb8e35d6b1f82620ae04681c4103e404114169ee367",
    "0xfee6533338057eb14bea3fb23557b88bbb76b5225bd48788cf5e2098e9f47d97",
    "0x70e8ac6d25d04a3ef714bd8c1abb6d768f92ec0a76e8b1bd015c626051ddda78",
    "0xff92a3b97f995c4febf6bcb6c9589270f3b23d0739f898914f29e3ee16490d2e",
    "0xf32ca51164df8a2abea5403335c7c8b99f194cc8e070f69952026f0fafaa4f88",
    "0x781978d3bf3571b72724b02837af3ed7fcefdf1f0413e4eae0c6d8f6374e1c65",
    "0x07593b085a4588649a9cf8a78a6f50fc883ddd59e7aabb40b8ff4db2130bb843",
    "0x08ef8a64090c1506d84dacb4b44317dca5c12897544b049334f6966188167cbc",
    "0xd1943183fe43a923868b01d25c5cf1b86aa42f5109c77e77e432cd883df55d2d",
    "0x12c8042dae92cfe34887cee6ff8b514a347b7b16835621e0ee38a37d5f1fbf8d",
    "0xf83e81dcaa1fee822fe8be58ef5518e63acbc2fb033e0f336207cfc2547bdede",
    "0x808508dacc90f477855fef2b7344465aeaf81d0bdd4cc97be5317a5d9b9cfcb8",
    "0x81e06e1cf98a4d91c50ca2c9cb46818dffced4b3dd6e4b3056f09b33f8480aaf",
    "0x85eacffc21c1766b162e4d9b17f5a5944c680b5ed5bfea1fcb139390aad22705",
    "0x6efb90aff24e026f8458ba2b4571cf6dea2faa63fd865b89141e5b8300cc0222",
    "0xbe7ac53c05780cca6f07d65858d9393dc6952a64bfcbc9dd8c37ae5e5223d369",
    "0x0000000003d69fb80f0bb5411149f4216c2c51b9003da672222d1b73349c00dc",
    "0xa7866c58bc55300608708eebeaf0154ff75d7b54c82d3f8ddafa5301b7df7b9d",
    "0x6ba4cc05e14f09d878c96f3a5ea43adffa2c813645723ff4f12447254a2f02a5",
    "0x43a4addf51a8f8fc8a04f1adc459690e393d0d2acba49d43ca659410308c8406",
    "0xc7e74c1d369de4e29c724f6ae513c8db7773a349679b3be1cc5a97e8c99dbc7c",
    "0x58bc27b9157be8af7bb26028f8e146b52fcce8452acf55e0973655e428137b41",
    "0x3308ef80c5b238d27a9883df005a930a365c02ef11046b835fb399b8a1188631",
    "0x2a57c92f34537a07f1741aa9dcd4787db3bb3df6d940ae7fca0c5b83054f8505",
    "0x00fccc3d89b43154e21c9dd44911949e1bc9a6dc0e8105d13311023108324847",
    "0x7c64c420a14d42dabf14d38cc97673c4ef0bbdfd698cbeffca141beb092535b6",
    "0x799f7fbf86c527ecbcf56c0043c9d3e800b019be5566c10dc079889dbe7edbed",
    "0xbac28cc946d8c67028f344bd7777622180fdf355154e45150566f3981d08fde9",
    "0xe2fd51cb0c570a96928bcc6e71ad18f9db124487b10f6d55dc29c3be74b90b61",
    "0xca1e6b510fc46a3ecfabab3e63b38b327206d305e775cc4b4280423c336843db",
    "0x35d56070c0ec1e259b99bcf30cb8cbcb3ada4bd445957d24e7d158f8cf51bb41",
    "0xffcc1a755dacb488b3b7e2719f85cef34a1aaf95b8e2a820a51d01aef52c40b0",
    "0x4b98176ccf3b7ef37971bb743165d14c97b1667ce02da10ab5152eefc2a9ec53",
    "0x6cb4e880af3026cac8dfa5e14e0ef9b6d45bd86f02d3d2bd1a19434d95247f3c",
    "0xc8b91d2725fe822a1f41bb323ef1ae3a3218a8f5b35af55f9a54d94ddb65b889",
    "0x351165cd88d4e13dba83ba8eea2a6712e159717cb49783102ec5b6a028f32cc9",
    "0x39a01904b49de885cd343f6dd054763f8782d8c2333dca4135b132f18781275c",
    "0x4b2ca4a892e1dbc9975cf1019dca2371f71ccaecd3da09296d6c39a6f9b0de54",
    "0x796e0e666da68becdc3ec15cf4c19567541bf76ef1152371db35ca537f566b42",
    "0x2c7107910abcaeaa8e1a360d53b4d3403f819847affee9468cb28b5c64eb51ec",
    "0x81c84ed20208c21ef0d56865a69e3863d32ce4a2bee6398f67b1a1e2919b8aa0",
    "0xdedaf1e79ad7c325ffaa98aa73cc4fdc3080e9fc816989dc478f90eef2990b23",
    "0x15b69def7d8650dc0f4e0c0cdfeeb5ca3c994d864f6711896d153e917bbb6868",
    "0x16cff08f8698c409857fa73e73a2b9e2c0030763ae64ef55496fa939ae33df6a",
    "0x90484ba4ea16a19a99c32caeabc3562df3342c7a7aa77f42f75aad7c33cb6ecc",
    "0x382943474da7dd0960687f8ea4b931010e464e69ed3a2da90393bf55ab90e0fc",
    "0x08866dc6f6a10478e7b1127db6dcf23cf435c9f02a384786743aff8975907ce5",
    "0x3bdfa83001fc9b46e071e3175b52a450317d9d77f17ed449bcde276679298e20",
    "0xb7fd4588fe20eb0fd249733e61afc6dab333a98660bed124df75550c895cf693",
    "0xde5c4cf5b730bde061b56b48a3d7ec30350641aa95a7f9a0d429fb66a64862e6",
    "0xf54fc9231f90480a67e27f527d7c80c45ddb6e5fdad6e16529270e2fc76e2fc5",
    "0x4f64449fbc3e17ad9328bec26b0928bcf3c45342ff7d71d7d772d972f33a91a3",
    "0x0ecaaac470e44f62671fdd8e8064a143e6554307790bb6c73e7db29c59cb710d",
    "0x564c525ad1d97996e0a0829d72e5185bd6d7e5c220dfced66e5ce6526bbdd5da",
    "0xda1ac6f9ef87c4c9d9f8c129cee6e995a3cdcb7ab05f1e2dd8d8a8d5ed5c989f",
    "0xb586d2a126dde0e55fd88816eddcbaabd8ccdb038e3ebbdc42bc132cff89efcf",
    "0x9b3832617cb1810e2ada291dd15378394c706241a7fa3f123d100b422bb98d82",
    "0xa1d0bb730060f3db6536956caa1084e70aab05813611062a69bac488826825d7",
    "0x910bbd2dd9757c60c8838e5878816c0719cf4c1240f230abeeb13e7edd8a44e8",
    "0xdbe3961cdfde0e2b29e296cba319cec4644dce833548344e1bc9eafcbc5da69a",
    "0xccf4c34ecc843f5cafe1b5590fb43ce0d6b2ab99924f36f8571eb11174d3b20b",
    "0x70aaf68d40c5f73cfcf21e412c362114cf0aff784c0d8e3f4bbb335cd3e320ec",
    "0x40f52b24eff18185cfddc8139270c8d5fd5a123d468d3321aae8679523e2471e",
    "0x0b61add6e7ba0ac34640443f2d384c00f5642c46fe6b2d19ee64fe1be7403f70",
    "0x968ae963dc76135fc92a379c33b3d9f3a991578ffa7bc63caa219247c3616d7e",
    "0xd95c3233c107c257ee7f550844918ade95cf4b08d12ebd0a8834234b926b3e59",
    "0xf2f9eb15c7c3dc9d138cdf317162aafcbebdbb4b1e70fdc0fcc771a0d40b3a33",
    "0x43d83315088b2c137e55f7c278b0f7ed27bb56049af9e4b1d5fa194a28d17f4a",
    "0x72cd9e1772fad0f00ee7369741d62d42032c3d1c469a6dff0602253f2848a242",
    "0x48a274b97edde732aeabd43252f7a96a8441622d19ccbd880c5c5292969cf665",
    "0xed0f34ef89abe8f1474f90fdd4cc6b9fb3511669d3e782a5712dba3949e60521",
    "0x8fcd56ec4bcef46fd98c024aa0697d7e97cd424f453b5e06e7219c02aac24d4f",
    "0xe133054086bb8ff8364d6620c50c9b2491d37a9a1a57699850622831b999460a",
    "0x7837eb7b6fa8462b392bf8bb7ef034a10cfd0c0250f4aa47f0bbc463805e6820",
    "0xaf0ac6debeffa02a4da328cae2a8873485ebbe24f7503918083a66885a42f09b",
    "0x682fb1119be2014375eccd00eca09b5c58d9c80b26e370ce04e8b2a2a4cdb3dc"
  ],
  "transactionsRoot": "0x104bcb2ae1f6739bf6e34f5ad959f50d86a230d4b02aacfb48a6a398a54489c3",
  "uncles": [],
  "withdrawals": [
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x107a05c",
      "index": "0x1ef8946",
      "validatorIndex": "0xfdb61"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x10861ef",
      "index": "0x1ef8947",
      "validatorIndex": "0xfdb62"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x108db0e",
      "index": "0x1ef8948",
      "validatorIndex": "0xfdb63"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x10846d2",
      "index": "0x1ef8949",
      "validatorIndex": "0xfdb64"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x10900d4",
      "index": "0x1ef894a",
      "validatorIndex": "0xfdb65"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x109513a",
      "index": "0x1ef894b",
      "validatorIndex": "0xfdb66"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x1077458",
      "index": "0x1ef894c",
      "validatorIndex": "0xfdb67"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x1091448",
      "index": "0x1ef894d",
      "validatorIndex": "0xfdb68"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x10915b8",
      "index": "0x1ef894e",
      "validatorIndex": "0xfdb69"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x10844c2",
      "index": "0x1ef894f",
      "validatorIndex": "0xfdb6a"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x1087b9a",
      "index": "0x1ef8950",
      "validatorIndex": "0xfdb6b"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x1085c93",
      "index": "0x1ef8951",
      "validatorIndex": "0xfdb6c"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x108998c",
      "index": "0x1ef8952",
      "validatorIndex": "0xfdb6d"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x106f010",
      "index": "0x1ef8953",
      "validatorIndex": "0xfdb6e"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x108b3ce",
      "index": "0x1ef8954",
      "validatorIndex": "0xfdb6f"
    },
    {
      "address": "0x32be2516f6e5ed1abc969d6e98b05bf54012abae",
      "amount": "0x108760d",
      "index": "0x1ef8955",
      "validatorIndex": "0xfdb70"
    }
  ],
  "withdrawalsRoot": "0x434b98a0e83c3a4cac2fee120e3d08bf049f02d4645c1143923196f9ba5a66ab"
}
RETH RPC
The first RPC service powered by RETH, 20ms faster on average and 10x cheaper.
Sign up
Transaction Stream
Stream all Ethereum, Polygon and BSC transactions to your application in real-time. Faster than any transaction stream on the market. Built with RETH.
Sign up
Simulation API
Simulate bundles of up to 10 transactions on Ethereum, Polygon and BSC for $0.2 / 1,000,000,000 of gas.
Sign up