Skip to content

Technical Differences

Emilie Ma edited this page Dec 25, 2022 · 1 revision

Cobweb is based on principles from Web Monetization and is mostly compatible with its API. (In practice, things will work as you expect - exclusive content will be unlocked and document.monetization will be updated with events.) However, there are some core differences:

Cryptocurrency Networks

Web Monetization is based on the XRP chain, with Coil as an intermediary for withdrawing payments and managing refilling your account.

Cobweb, on the other hand, is based on streamed micropayments with Superfluid.finance on the Ethereum chain. Cobweb itself does not have a deployed smart contract, and relies on the Superfluid contracts, which have been thoroughly audited.

Authentication and Payment Handling

Web Monetization requires you to have a Coil account, as well as a payment pointer through a wallet provider.

Cobweb requires you to have an Ethereum address and a MetaMask wallet. (Note: additional wallet support is planned.)

JavaScript API and Receiving Payments

Cobweb's JavaScript API is largely the same as the Web Monetization API. Cobweb emits the same events with the same datatypes, albeit with ENS or Ethereum addresses instead of payment pointers.

Cobweb does not conform to the WM API in one notable way - receiving payments. Because the Ethereum blockchain handles the payments, Cobweb cuts out the payment provider and hence the complex receiving infrastructure. For example, the requestId sent with each event is not a STREAM protocol-adherent ID, but an UUID.

For developers, this should not make a significant difference. The payments will be processed by the blockchain, and Cobweb optimistically emits the payment events. If you wish to ensure a payment stream has initiated, you can directly access the streams GraphQL with Superfluid's Subgraph.