<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>William Entriken Blog</title>
    <description>Essays by William Entriken</description>
    <link>https://blog.phor.net/</link>
    <atom:link href="https://blog.phor.net/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Wed, 11 Mar 2026 04:52:13 +0000</pubDate>
    <lastBuildDate>Wed, 11 Mar 2026 04:52:13 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>DeFi primitives for RWA</title>
        <description>&lt;p&gt;In &lt;a href=&quot;2025-12-20-one-core-finance-function.md&quot;&gt;the previous articles&lt;/a&gt; about &lt;a href=&quot;2025-12-30-one-core-defi-function.md&quot;&gt;reconstructing finance in DeFi&lt;/a&gt;, we looked at the basic function of finance: asset supply, asset lending and liquidation. And we studied the minimum ways to apply this in a traditional system with legal and regulator recourse as well as a rules based blockchain system. Next we will look specifically at the finance primitives related to real world assets (RWA) onchain.&lt;/p&gt;

&lt;p&gt;But first, what are real world assets?&lt;/p&gt;

&lt;h2 id=&quot;what-are-real-world-assets-rwa&quot;&gt;What are real world assets (RWA)?&lt;/h2&gt;

&lt;p&gt;I am not ready to take a stand on defining what are RWAs. So I will tell you what many people are using this word for, and why some of it sounds silly to me. You can make your own conclusions and I won’t argue you yet.&lt;/p&gt;

&lt;p&gt;One broad definition of RWAs is “any asset that does not exist solely on chain” or “any asset that is not solely on-chain or on IPFS”. Or even “any asset that does not exist solely on-chain or a media file hosted somewhere.”&lt;/p&gt;

&lt;p&gt;These nitpicks matter to some people that spent a lot of money on &lt;a href=&quot;2021-09-29-nft-contract-before-terra-nullius.md&quot;&gt;non-fungible tokens&lt;/a&gt; (NFTs) representing images.&lt;/p&gt;

&lt;p&gt;Another definition of RWAs is “any kind of asset that existed before the year 2000”.&lt;/p&gt;

&lt;p&gt;Another definition of RWAs is “if aliens were looking down at us from space and they saw you holding something, and they saw you using it, and they were like ‘oh wow I understand that this person is using this thing’, then that is a real world asset.”&lt;/p&gt;

&lt;table class=&quot;table&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Example&lt;/th&gt;
      &lt;th&gt;Off-chain&lt;/th&gt;
      &lt;th&gt;Before 2000&lt;/th&gt;
      &lt;th&gt;Alien-use&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Bitcoin (when inside Ethereum Mainnet)&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;NO&lt;/td&gt;
      &lt;td&gt;NO&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Gold (segregated storage)&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Gold (mixed storage)&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;NO&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;House&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Car&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Stock share&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;NO&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Black Lotus MtG card&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
      &lt;td&gt;YES&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;In all cases, a real world asset implies some kind of custody. And therefore you must remember &lt;a href=&quot;https://x.com/fulldecent/status/978777547772170242&quot;&gt;Entriken’s Law&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Your ownership of assets on a ledger is only as valid as your trust in the custodian who has physical control of the assets.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This applies because the assets are recorded on a blockchain, which is a ledger. But the assets themselves are not on the blockchain, they are held somewhere by some custodian.&lt;/p&gt;

&lt;h2 id=&quot;what-primitives-apply-to-any-rwa&quot;&gt;What primitives apply to any RWA?&lt;/h2&gt;

&lt;p&gt;Let’s think about some of the exceptional situations that could apply to a real world asset.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;It could be irreparably damaged.&lt;/li&gt;
  &lt;li&gt;It could be stolen.&lt;/li&gt;
  &lt;li&gt;The custodian could fail to honor commitments they have made about the asset.&lt;/li&gt;
  &lt;li&gt;The custodian could be unable to honor some specific commitments due to legal or regulatory restrictions.&lt;/li&gt;
  &lt;li&gt;The custodian could become incapacitated or unreachable.&lt;/li&gt;
  &lt;li&gt;The custodian may have never made committments about the asset that you thought they made.&lt;/li&gt;
  &lt;li&gt;The asset may not be what you thought it was.&lt;/li&gt;
  &lt;li&gt;The asset may cease to provide the benefits you expected.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You also need to clearly understand if the blockchain token is a &lt;strong&gt;companion token&lt;/strong&gt; or a &lt;strong&gt;custodian token&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Anyway, studying these exceptional situations do not necessarily tell you what DeFi primatives you need. But as a concept you need to be prepared for these circumstances.&lt;/p&gt;

&lt;h2 id=&quot;defi-primitives-for-profit-generating-enterprises&quot;&gt;DeFi primitives for profit generating enterprises&lt;/h2&gt;

&lt;p&gt;If a profit generating enterprise will want to share its benefits with on-chain participants, there are several approachs.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Perform snapshot of on-chain token holders, and distribute benefits off-chain to them.&lt;/li&gt;
  &lt;li&gt;Perform snapshot of on-chain token holders, and distribute benefits on-chain to them. (Similar to how &lt;a href=&quot;2022-11-04-opensea-shared-storefront-backdoor.md&quot;&gt;OpenSea broadcasts royalties&lt;/a&gt; for NFTs).&lt;/li&gt;
  &lt;li&gt;Execute a multi-award reverse auction to buy tokens and then burn them.&lt;/li&gt;
  &lt;li&gt;Execute a market purchase order against an on-chain DEX to buy tokens and then burn them.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Any decentralized way to implement a multi-award reverse auction will need fees and other countermeasures to prevent spam and DoS attacks. These are worth exploring further. But for simplicity, I will recommend using the market purchase order.&lt;/p&gt;

&lt;p&gt;The market purchase contract can work just like UniSwap. But it needs a small lockup period to prevent front running specifically related to the lumpy purchase:&lt;/p&gt;

&lt;div class=&quot;language-solidity highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;minimumLockupAnnouncementPeriod&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;days&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;maximumLockupPeriod&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;hours&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;minimumNonlockupPeriod&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;30&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;days&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lockupPeriodStartTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;external&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;view&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;returns&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;startTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lockupPeriodEndTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;external&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;view&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;returns&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;endTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;designatedBuyer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;external&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;view&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;returns&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;address&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buyer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;event&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;LockupPeriodCreated&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;startTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;endTime&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;/// @notice Creates a lockup period during which only the designated buyer can purchase/withdraw tokens.
/// @description Swaps to buy tokens and liquidation from the pool are disabled during the lockup time for all except
/// the designated buyer. This is to prevent front running of large market purchase orders.
///
/// Fails if lockup period is currently active or the minimums/maximums are not satisfied.
///
/// @param startTime The timestamp when the lockup period starts.
/// @param endTime The timestamp when the lockup period ends.
/// @param buyer The address of the designated buyer who can purchase tokens during the lockup period.
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;createLockupPeriod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;startTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;endTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;address&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buyer&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;external&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;onlyRole&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ADMIN_ROLE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// ... remaining functions are a normal DEX interface ...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;multiparty-crowdsale-primatives-for-secondary-sales&quot;&gt;Multiparty crowdsale primatives for secondary sales&lt;/h2&gt;

&lt;p&gt;Another unique situation for onboarding RWAs is the crowdsale from an in-group to an out-group.&lt;/p&gt;

&lt;p&gt;In this scenario, a group of people are holding tokens and trading amonng themselves. This is enforced by an allow list. However, after a successful crowdsale event, the transfers allow list is removed and the tokens can be traded freely on-chain.&lt;/p&gt;

&lt;p&gt;This aligns with business reality where managing a closely held group of token holders is simpler than managing a large open group. And satisfying a threshold value can make this worthwhile.&lt;/p&gt;

&lt;div class=&quot;language-solidity highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;minimumCrowdsalePeriod&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;days&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;maximumCrowdsalePeriod&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;90&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;days&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;finalizationPeriod&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;days&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;wasCrowdsaleSuccessful&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;crowdsaleId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;external&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;view&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;returns&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;successful&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;event&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;CrowdsaleScheduled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;indexed&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;crowdsaleId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;startTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;endTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ERC20&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tokenForSale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ERC20&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;paymentToken&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pricePerSaleTokenEE18&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;event&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;CrowdsaleParticipation&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;indexed&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;crowdsaleId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;address&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;indexed&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;participant&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;amountOfSaleTokensPurchased&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;amountOfPaymentTokensSpent&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;event&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;CrowdsaleFinalized&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;indexed&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;crowdsaleId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;successful&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;/// @notice Starts a crowdsale period during which transfers are only allowed to/from the allow list.
/// @param startTime The timestamp when the crowdsale starts.
/// @param endTime The timestamp when the crowdsale ends.
/// @param tokenForSale The ERC20 token being sold in the crowdsale.
/// @param paymentToken The ERC20 token used for payment in the crowdsale.
/// @param pricePerSaleTokenEE18 The price per sale token, expressed in payment tokens with 18 decimals.
/// @dev Fails if the crowdsale period is currently active or the minimums/maximums are not satisfied.
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;scheduleCrowdsale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;startTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;endTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ERC20&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tokenForSale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ERC20&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;paymentToken&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pricePerSaleTokenEE18&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;external&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;onlyRole&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ADMIN_ROLE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;/// @notice Participates in an active crowdsale by purchasing sale tokens with payment tokens.
/// @param crowdsaleId The identifier of the crowdsale to participate in.
/// @param amountOfSaleTokensToPurchase The amount of sale tokens the participant wishes to purchase.
/// @dev Fails if the crowdsale is not active, if there are insufficient payment tokens,
/// or if the purchase exceeds the available sale tokens. Marks as finalized if full allocation reached.
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;participateInCrowdsale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;crowdsaleId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;amountOfSaleTokensToPurchase&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;external&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Be sure to calculate dust payments correctly at the end!
&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;/// @notice Withdraws purchased sale tokens after the crowdsale has finalized or original tokens if unsuccessful.
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;withdraw&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;crowdsaleId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;address&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;participant&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;external&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then the actual token contract needs to allow one-time unlock if crowdsale is successful&lt;/p&gt;

&lt;div class=&quot;language-solidity highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;address&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;crowdsaleContract&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;crowsaleId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transfersLockedForCrowdsale&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;/// @notice Overrides the standard transfer function to enforce crowdsale transfer restrictions.
/// @param to The address to transfer tokens to.
/// @param amount The amount of tokens to transfer.
/// @dev If transfers are locked for crowdsale, only allow transfers to/from addresses on the allow list.
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;transfer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;address&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;amount&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;returns&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;bool&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;transfersLockedForCrowdsale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;isAddressOnAllowList&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sender&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;isAddressOnAllowList&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;&quot;Transfers are locked for crowdsale; only allowed to/from allow list addresses.&quot;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;transfer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;amount&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;/// @notice Sets the crowdsale contract address and ID for transfer unlocking.
/// @param _crowdsaleContract The address of the crowdsale contract.
/// @param _crowdsaleId The identifier of the crowdsale.
/// @dev Can only be called once by an admin role.
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;setCrowdsaleContract&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;address&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_crowdsaleContract&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_crowdsaleId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;external&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;onlyRole&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ADMIN_ROLE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;crowdsaleContract&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;address&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;revert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Crowdsale contract already set&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;crowdsaleContract&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_crowdsaleContract&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;crowsaleId&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_crowdsaleId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;/// @notice Unlocks transfers after a successful crowdsale.
/// @dev Anybody can call this function, but it will only succeed if the crowdsale was successful.
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;unlockTransfersAfterCrowdsale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;external&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;crowdsaleContract&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;address&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Crowdsale contract not set&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ICrowdsale&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;crowdsale&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ICrowdsale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;crowdsaleContract&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;crowdsale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;wasCrowdsaleSuccessful&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;crowsaleId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Crowdsale was not successful&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;transfersLockedForCrowdsale&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Sun, 04 Jan 2026 00:00:00 +0000</pubDate>
        <link>https://blog.phor.net/defi-primatives-for-rwa</link>
        <guid isPermaLink="true">https://blog.phor.net/defi-primatives-for-rwa</guid>
        
        <category>blockchain</category>
        
        
      </item>
    
      <item>
        <title>Reconstructing the core finance function in DeFi</title>
        <description>&lt;p&gt;In &lt;a href=&quot;2025-12-20-one-core-finance-function.md&quot;&gt;the previous article&lt;/a&gt;, we established a first-principles definition of finance as the trifecta of asset supply, lending, and liquidation. This core function contributes to an economy by allowing assets to be temporarily transferred with built-in mechanisms for repayment and recourse on default. We examined examples like bank deposits and repos, as well as non-examples like equity purchases and basic insurance, to illustrate the boundaries of this definition.&lt;/p&gt;

&lt;p&gt;At the end of that article, we naively considered a two-party lending scenario on blockchain. But quickly we found that it doesn’t work as-is, because in a decentralized, permissionless environment, when you transfer an asset to a borrower, they can simply disappear without repaying the loan. You have no recourse. And therefore that is not finance.&lt;/p&gt;

&lt;p&gt;Let’s go ahead and construct the minimal implementation of this core finance function using blockchain. Then we can examine its contours, and see if other shapes are possible.&lt;/p&gt;

&lt;h2 id=&quot;seeking-the-minimal-defi-implementation-of-the-core-finance-function&quot;&gt;Seeking the minimal DeFi implementation of the core finance function&lt;/h2&gt;

&lt;p&gt;To viably implement the core finance function on blockchain, we must employ a rules-based system that can hold assets in escrow. On an account-based blockchain, smart contracts provide this ability.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;sequenceDiagram
    participant Supplier
    participant Automated escrow
    participant Borrower
    Supplier-&amp;gt;&amp;gt;Automated escrow: Supplies asset
    Borrower-&amp;gt;&amp;gt;Automated escrow: Deposits collateral + fee
    Automated escrow-&amp;gt;&amp;gt;Borrower: Releases lent asset
    alt Return
        Borrower-&amp;gt;&amp;gt;Automated escrow: Returns asset
        Automated escrow-&amp;gt;&amp;gt;Supplier: Returns asset + fee
        Automated escrow-&amp;gt;&amp;gt;Borrower: Returns collateral
    else Default
        Automated escrow-&amp;gt;&amp;gt;Supplier: Releases collateral + fee
    end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;First, notice how the order of operations matters, all deposits must be secured before any assets are released. This model is very similar to the traditional finance of selling a call option, but the individual steps are slightly reordered.&lt;/p&gt;

&lt;h2 id=&quot;rational-actors&quot;&gt;Rational actors&lt;/h2&gt;

&lt;p&gt;Let’s think why the supplier and borrower would agree to this arrangement. First let’s consider if the actors don’t care anything about the asset, or the collateral, and only care about profit.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The supplier will expect to receive a fee (“interest”) for lending out their asset. And they accept some risk that they may not receive their asset back (probably if the asset value skyrockets).&lt;/li&gt;
  &lt;li&gt;If the borrower only wants to use the asset for profit, they would be happy to join this arrangement if they expect the value of the asset to drop more than the fee they pay and the opportunity cost of their collateral.
    &lt;ul&gt;
      &lt;li&gt;Pay some collateral.&lt;/li&gt;
      &lt;li&gt;Borrow asset, sell it.&lt;/li&gt;
      &lt;li&gt;Buy it back cheaper, return it.&lt;/li&gt;
      &lt;li&gt;Pay fee, get collateral back, keep net profit.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;The asset may generate valuable consideration throughout the duration of the scheme, and this would impact the rational calculations of both parties.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other rational benefits are possible:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The asset may provide some utility to the borrower: access to a party, authority to participate in a game.&lt;/li&gt;
  &lt;li&gt;The asset may comprise some negative-value liability or carying cost. Transferring it may relieve the supplier of this burden.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although other rational benefits are possible, my experience is that the vast majority of transactionss following this pattern are motivated by profit. And the vast majority of the underlying value are blockchain tokens, whose value is primarily derived from fees from people who make these speculative transactions.&lt;/p&gt;

&lt;h2 id=&quot;basic-variations-to-this-flow&quot;&gt;Basic variations to this flow&lt;/h2&gt;

&lt;p&gt;Many details can modify this basic implementation to get interesting new applications:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The supplier and/or borrower may preauthorize the terms of some agreement (“be a maker”), inviting anybody else to immediately consummate (“be a taker”).&lt;/li&gt;
  &lt;li&gt;The escrow may send the fee to the supplier immediately when the borrower deposits it, drip it over time or send it all at the end.&lt;/li&gt;
  &lt;li&gt;The escrow may accept collateral some kind of collateral from the borrower and use the open market to satisfy what the supplier requires.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;auto-rolling-loans&quot;&gt;Auto-rolling loans&lt;/h2&gt;

&lt;p&gt;Most people that use blockchain and token markets on them will be familiar with the auto-rolling loan.&lt;/p&gt;

&lt;p&gt;To realize auto-rolling, the supplier and the borrower agree on a collateralization ratio rather than a specific performance of collateral. “Collateral of XXX% the market of the lent asset shall be on deposit.” If the borrower is undercollateralized then the lender may liquidate to receive the impaired collateral.&lt;/p&gt;

&lt;p&gt;These systems typically allow anybody to initiate the liquidation. And that is why things blow up spectacularly around market corrections.&lt;/p&gt;

&lt;h2 id=&quot;the-funny-thing-is-centralization&quot;&gt;The funny thing is centralization&lt;/h2&gt;

&lt;p&gt;Platforms such as Compound and Aave implement the repricing of loans by working as a special participant in the system. The monitor different marketplaces and publish interest rates into the smart contracts. This completely undermines the definition of “decentralized” in DeFi. And it typically allows this party to take all of the assets out of the system if they wanted to. All they need to do is make one new kind of asset, own all of that asset and tell the system that asset is worth infinity. Then borrow against it. Game over.&lt;/p&gt;

&lt;p&gt;This centralized lending application is the main thing that people call “DeFi” today.&lt;/p&gt;

&lt;h2 id=&quot;other-applications&quot;&gt;Other applications&lt;/h2&gt;

&lt;p&gt;Several other applications on blockchain are notable. Let’s see if they fit our definition of finance and other ways we can review them.&lt;/p&gt;

&lt;h3 id=&quot;example-decentralized-options-protocols&quot;&gt;Example: decentralized options protocols&lt;/h3&gt;

&lt;p&gt;These protocols allow users to sell options by supplying rights (via tokens), with exercise as “repayment” and collateral liquidation on failure. This fits the trifecta of supply, lending, and liquidation. See also our note that options ARE a finance application.&lt;/p&gt;

&lt;h3 id=&quot;non-example-nft-sale-marketplaces&quot;&gt;Non-example: NFT sale marketplaces&lt;/h3&gt;

&lt;p&gt;Buying/selling NFTs is asset transfer, like equity shares—no lending or liquidation. Therefore, it does not fit our definition of finance.&lt;/p&gt;

&lt;p&gt;Take special note of one kind of application, when an NFT is supplied or used as collateral in finance, but where a different NFT from the same collection or meeting some specific criteria is accepted as a replacement to unwind the position. A similar approach is when you make open-ended floor bids for an NFT collection (regardless of which specific NFT you will get), and then somebody incentivizes you for being the highest bidder.&lt;/p&gt;

&lt;p&gt;These two adapters allow NFTs to work with liquidity pools.&lt;/p&gt;

&lt;p&gt;I’ve seen so many people propose NFT lending, and some companies even tried it. Doing that would really bastardize the artwork that some NFTs represent. But I do note that nowadays, Blur and OpenSea would probably make more money with this product than their current offering.&lt;/p&gt;

&lt;h3 id=&quot;non-example-decentralized-exchanges-dex-eg-uniswap&quot;&gt;Non-example: decentralized exchanges (DEX) e.g., Uniswap&lt;/h3&gt;

&lt;p&gt;A decentralized exchange is a marketmaking system governed entirely by pre-arranged rules. Assets of two or more types are collected. And the then the system allows anybody to swap between the assets according to the rules. Swapping the assets affects the price according to supply and demand.&lt;/p&gt;

&lt;p&gt;There are several ways to look at this system. If you are interacting with it to buy or sell tokens, you are simply trading assets. This is not a finance function.&lt;/p&gt;

&lt;p&gt;But if you look at it from the other perspective, people that supply the assets, then yes it is a finance application. Those people can retrieve their assets plus fees later. Or if the assets are not there their alternative benefit is the other assets in the pool.&lt;/p&gt;

&lt;h3 id=&quot;equity-like-investments&quot;&gt;Equity-like investments&lt;/h3&gt;

&lt;p&gt;Direct purchase of an equity token is not finance. Even if that token entitles you to receive dividends or other benefits. Because the transaction is fundamentally identical to purchasing bread, or an orange tree that yields fruit.&lt;/p&gt;

&lt;p&gt;Blockchain tokens that cover ownership in a enterprise will be a major blockchain use case going fowrard. And there are many reasons to watch this space for future developments.&lt;/p&gt;

&lt;h2 id=&quot;next-steps&quot;&gt;Next steps&lt;/h2&gt;

&lt;p&gt;In &lt;a href=&quot;2026-01-04-defi-primatives-for-rwa.md&quot;&gt;the next article&lt;/a&gt;, we examine DeFi primitives specifically for real world assets (RWA), including custodial considerations and unique primitives for profit-generating enterprises and crowdsales.&lt;/p&gt;
</description>
        <pubDate>Tue, 30 Dec 2025 00:00:00 +0000</pubDate>
        <link>https://blog.phor.net/one-core-defi-function</link>
        <guid isPermaLink="true">https://blog.phor.net/one-core-defi-function</guid>
        
        <category>blockchain</category>
        
        <category>defi</category>
        
        
      </item>
    
      <item>
        <title>The one core function of finance</title>
        <description>&lt;p&gt;Finance has one core function: asset supply, asset lending and liquidation, all tied together. In this article we test this definition of finance, show that nothing else is actually finance and look forward to how traditional finance and decentralized finance, DeFi, (e.g. on blockchain) implement this core function.&lt;/p&gt;

&lt;p&gt;This is a first principles look at finance.&lt;/p&gt;

&lt;h2 id=&quot;the-core-lending-primitive&quot;&gt;The core lending primitive&lt;/h2&gt;

&lt;p&gt;Finance provides a basic function in an economy, which is the supply/lending of assets, backed by the threat of liquidation. This is a trifecta. If any of these is missing, you are not talking about finance, you are talking about something else.&lt;/p&gt;

&lt;p&gt;Let’s see it!&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Supply&lt;/strong&gt;: a &lt;strong&gt;supplier&lt;/strong&gt; provides an asset, expecting that asset back and some additional benefit&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Lending&lt;/strong&gt;: a &lt;strong&gt;borrower&lt;/strong&gt; receives the asset, expecting to return it and provide some additional benefit&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Liquidation&lt;/strong&gt;: in the exceptional case that the borrower does return the asset, the supplier shall have some other alternate benefit&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;sequenceDiagram
    participant Supplier
    participant Borrower
    
    Supplier-&amp;gt;&amp;gt;Borrower: Provides asset
    
    alt Return
        Borrower-&amp;gt;&amp;gt;Supplier: Returns asset + benefit
    else Default
        Supplier-&amp;gt;&amp;gt;Supplier: Benefits from liquidation
    end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This diagram shows the prototype of everything in finance. Depending on how the liquidation works, or what third parties are involved, you may see different names and details. The names and details matter, because they often define what laws and regulations apply. &lt;mark&gt;In finance, something can be legal or illegal based on what you name it!&lt;/mark&gt; So pay attention.&lt;/p&gt;

&lt;p&gt;Let review some examples of applying this core function. &lt;em&gt;And while we’re doing this, keep in mind that DeFi (e.g. on blockchain) only sees tokens and rules-based systems—it doesn’t care what the names of things are. If two things are the same, but use different names, DeFi can just substitute one for the other.&lt;/em&gt;&lt;/p&gt;

&lt;h3 id=&quot;example-bank-deposit-account&quot;&gt;Example: bank deposit account&lt;/h3&gt;

&lt;p&gt;A bank deposit account is a classic example of these three primitives. The supplier is the &lt;strong&gt;depositor&lt;/strong&gt; who &lt;strong&gt;deposits money&lt;/strong&gt; to the bank. The borrower is the &lt;strong&gt;bank&lt;/strong&gt; which receives the money and promises to return it on demand, plus some &lt;strong&gt;interest&lt;/strong&gt; as benefit. The liquidation is typically well-defined, through &lt;strong&gt;legal systems and bank deposit insurance&lt;/strong&gt;. This finance function is offered by a bank, and they are the second party to the agreement. The bank pays the legal system or bank deposit insurance some taxes and/or premium in this scheme.&lt;/p&gt;

&lt;details&gt;
  &lt;summary&gt;Sequence diagram&lt;/summary&gt;

  &lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;sequenceDiagram
    participant Depositor
    participant Bank
    participant Legal system or bank deposit insurance
    
    Depositor-&amp;gt;&amp;gt;Bank: Deposits money
    Bank-&amp;gt;&amp;gt;Legal system or bank deposit insurance: Pays taxes and insurance premium
    
    alt Bank repays
        Bank-&amp;gt;&amp;gt;Depositor: Returns money + interest
    else Bank fails
        Legal system or bank deposit insurance-&amp;gt;&amp;gt;Depositor: Pays insured amount
    end
&lt;/code&gt;&lt;/pre&gt;

&lt;/details&gt;

&lt;h3 id=&quot;non-example-purchasing-equity-shares&quot;&gt;Non-example: purchasing equity shares&lt;/h3&gt;

&lt;p&gt;Purchasing equity shares in a company does not constitute finance under this core definition, as it misses the lending and liquidation pillars of the trifecta. An investor exchanges money for ownership—a “thing” granting potential benefits like dividends or voting rights—without any structured repayment or alternate benefit on default. These benefits, whether monetary or otherwise, are not fundamentally different from those derived from buying a portion of a church, a country club membership, or even an orange tree that yields fruit; all involve risk, time value, and possible resale, yet none inherently qualify as finance. Labeling such transactions as “finance” often serves to inflate sophistication, but they are merely asset acquisitions or brokering.&lt;/p&gt;

&lt;details&gt;
  &lt;summary&gt;Sequence diagram&lt;/summary&gt;
  &lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;sequenceDiagram
    participant Buyer
    participant Seller/company
    Buyer-&amp;gt;&amp;gt;Seller/company: Pays money
    Seller/company-&amp;gt;&amp;gt;Buyer: Transfers shares
    note over Buyer: Potential benefits (e.g., dividends, resale), no repayment or liquidation mechanism
&lt;/code&gt;&lt;/pre&gt;
&lt;/details&gt;

&lt;h3 id=&quot;example-selling-a-call-option&quot;&gt;Example: selling a call option&lt;/h3&gt;

&lt;p&gt;Selling a call option embodies the core finance function, fulfilling the trifecta of supply, lending, and liquidation. The supplier—&lt;strong&gt;option seller&lt;/strong&gt;—provides the right to buy an underlying asset at a set strike price, expecting to keep the &lt;strong&gt;premium&lt;/strong&gt; as benefit if unexercised. The borrower—&lt;strong&gt;option buyer&lt;/strong&gt;—receives this right, paying the premium upfront with the intent to &lt;strong&gt;exercise&lt;/strong&gt; if profitable. Liquidation triggers upon exercise: the seller delivers the asset and gains the strike price as alternate benefit, distinct from mere asset exchange. This structure mirrors the unique baseline of finance, where benefits arise from timed obligations and risks, not speculative ownership.&lt;/p&gt;

&lt;details&gt;
  &lt;summary&gt;Sequence diagram (simplified)&lt;/summary&gt;
  &lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;sequenceDiagram
    participant Seller
    participant Buyer
    Seller-&amp;gt;&amp;gt;Buyer: Provides the exclusive right to acquire underlying asset
    Buyer-&amp;gt;&amp;gt;Seller: Pays premium
    alt Expires worthless
        Buyer-&amp;gt;&amp;gt;Seller: Exclusive right retires
    else Exercised
        Buyer-&amp;gt;&amp;gt;Seller: Pays strike price
        Seller-&amp;gt;&amp;gt;Buyer: Provides assets
    end
&lt;/code&gt;&lt;/pre&gt;
&lt;/details&gt;

&lt;p&gt;There are a couple important notes about equity options. In order to properly write a call you must own the underlying asset. And you must deliver it to a brokerage. And during the time that your call is active, you are unable to remove your underlying from the brokerage. If the equity produces dividends, you receive them. In other words, you do not own the asset at that time. Tax rules and accounting rules in many (all?) jurisdictions ignore this ownership concept, but the below diagram does not.&lt;/p&gt;

&lt;details&gt;
  &lt;summary&gt;Sequence diagram (actual)&lt;/summary&gt;
  &lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;sequenceDiagram
    participant Seller
    participant Broker
    participant Buyer
    Seller-&amp;gt;&amp;gt;Broker: Supplies underlying asset/margin
    Broker-&amp;gt;&amp;gt;Buyer: Assigns exclusive right to acquire asset
    Buyer-&amp;gt;&amp;gt;Broker: Pays premium
    Broker-&amp;gt;&amp;gt;Seller: Pays premium
    alt Expires worthless
        Buyer-&amp;gt;&amp;gt;Broker: Exclusive right retires
        Broker-&amp;gt;&amp;gt;Seller: Returns asset/margin
    else Exercised
        Buyer-&amp;gt;&amp;gt;Broker: Pays strike price
        Broker-&amp;gt;&amp;gt;Seller: Pays strike price
        Broker-&amp;gt;&amp;gt;Buyer: Transfers asset
    end
&lt;/code&gt;&lt;/pre&gt;
&lt;/details&gt;

&lt;p&gt;This “actual” diagram shows both sides with the broker in the middle. Each leg of the transaction is a separate finance function. And the broker, as the holder of the underlying asset (also known as an &lt;strong&gt;owner&lt;/strong&gt; for some definitions of ownership), participates in both legs.&lt;/p&gt;

&lt;h3 id=&quot;non-example-home-insurance-policy&quot;&gt;Non-example: home insurance policy&lt;/h3&gt;

&lt;p&gt;Ben Franklin founded a fire insurance company, the Philadelphia Contributionship for the Insurance of Houses from Loss by Fire in 1752.&lt;/p&gt;

&lt;p&gt;At this time of its founding, this was not contemporaneously considered a finance function. And according to our core definition of finance, it still is not.&lt;/p&gt;

&lt;details&gt;
  &lt;summary&gt;Sequence diagram&lt;/summary&gt;
  &lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;sequenceDiagram
    participant Policyholder
    participant Insurer
    Policyholder-&amp;gt;&amp;gt;Insurer: Pays premium
    Insurer-&amp;gt;&amp;gt;Policyholder: Provides coverage promise
    alt No claim/event
        note over Insurer: Retains premium, no payout
    else Valid claim reported
        Insurer-&amp;gt;&amp;gt;Policyholder: Pays reimbursement
    end
    note over Policyholder: No repayment or liquidation mechanism
&lt;/code&gt;&lt;/pre&gt;
&lt;/details&gt;

&lt;p&gt;Now, an important note, and specifically about this 1752 insurance company (still operating today). They do offer a perpetual policy, you pay a premium as a deposit and they do provide coverage as long as your deposit is with them. You can demand your deposit back and you lose coverage. Such a perpetual policy defeats this classification here and indeed is a finance function.&lt;/p&gt;

&lt;h3 id=&quot;example-repurchase-agreement-repo&quot;&gt;Example: repurchase agreement (repo)&lt;/h3&gt;

&lt;p&gt;This is a staple short-term funding tool, often used by banks or institutions. It fits the trifecta perfectly: a &lt;strong&gt;supplier&lt;/strong&gt; provides securities (asset), a &lt;strong&gt;borrower&lt;/strong&gt; receives cash (using the asset as collateral), with &lt;strong&gt;repurchase&lt;/strong&gt; as repayment plus interest, and &lt;strong&gt;liquidation&lt;/strong&gt; via keeping/selling collateral on default.&lt;/p&gt;

&lt;details&gt;
  &lt;summary&gt;Sequence diagram&lt;/summary&gt;
  &lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;sequenceDiagram
    participant Seller
    participant Lender
    Seller-&amp;gt;&amp;gt;Lender: Transfers securities (asset)
    Lender-&amp;gt;&amp;gt;Seller: Pays cash (loan amount)
    alt Repurchase (repays)
        Seller-&amp;gt;&amp;gt;Lender: Pays cash + repo rate (benefit)
        Lender-&amp;gt;&amp;gt;Seller: Returns securities
    else Default
        Lender-&amp;gt;&amp;gt;Lender: Keeps/sells securities (liquidation benefit)
    end
&lt;/code&gt;&lt;/pre&gt;
&lt;/details&gt;

&lt;p&gt;The reading circle question here is which entity is the supplier and which is the borrower?&lt;/p&gt;

&lt;p&gt;The economic reality of a repurchase arrangement is equivalent to a pawn brokering arrangement. Tax and regulatory treatment for these two scenarios very wildly. And typically matters such as classifications of the underlying asset have an impact on which rules apply.&lt;/p&gt;

&lt;h2 id=&quot;onward-with-defi&quot;&gt;Onward with DeFi&lt;/h2&gt;

&lt;p&gt;Decentralized finance, DeFi, typically implemented on blockchain, can implement the analog of core finance functions using tokens and smart contracts.&lt;/p&gt;

&lt;p&gt;Let’s see how the minimum core function of finance applies in DeFi.&lt;/p&gt;

&lt;p&gt;Since we are considering “decentralized” applications, we will assume that parties do not have legal recourse to each other. &lt;mark&gt;Using the same basic implementation breaks down quickly&lt;/mark&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;sequenceDiagram
    participant Supplier
    participant Borrower
    
    Supplier-&amp;gt;&amp;gt;Borrower: Provides asset
    
    alt Return
        Note over Borrower: Disappears
    else Default
        Note over Borrower: Disappears
    end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In &lt;a href=&quot;2025-12-30-one-core-defi-function.md&quot;&gt;the next article&lt;/a&gt;, we build up the minimum implementation of finance using DeFi tooling and study its utility along with other blockchain token application patterns to see if they meet our core definition of finance. We then examine &lt;a href=&quot;2026-01-04-defi-primatives-for-rwa.md&quot;&gt;DeFi primitives for real world assets&lt;/a&gt; (RWA) onchain.&lt;/p&gt;

&lt;h2 id=&quot;further-reading&quot;&gt;Further reading&lt;/h2&gt;

&lt;p&gt;Our loan-only definition of finance resonates more hundreds of years ago. But for modern works, see: Joseph Schumpeter (1910s) and John Gurley &amp;amp; Edward Shaw (1950s) various works on role of finance in the economy and their definitions.&lt;/p&gt;

&lt;p&gt;This first principles are important to understand as we build DeFi and new financial systems.&lt;/p&gt;

&lt;h2 id=&quot;footnotes&quot;&gt;Footnotes&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;We define the &lt;strong&gt;owner&lt;/strong&gt; of an asset as the exclusive entity that may decide to burn/destroy a thing without recourse to anybody else.&lt;/li&gt;
&lt;/ol&gt;
</description>
        <pubDate>Sat, 20 Dec 2025 00:00:00 +0000</pubDate>
        <link>https://blog.phor.net/one-core-finance-function</link>
        <guid isPermaLink="true">https://blog.phor.net/one-core-finance-function</guid>
        
        <category>blockchain</category>
        
        
      </item>
    
      <item>
        <title>ERC-2535 and Diamond Standard, Inc, trademark questions</title>
        <description>&lt;p&gt;Here is the Diamond Standard &lt;a href=&quot;https://tsdr.uspto.gov/#caseNumber=88546788&amp;amp;caseSearchType=US_APPLICATION&amp;amp;caseType=DEFAULT&amp;amp;searchType=statusSearch&quot;&gt;filing in USPTO&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And here you can see their &lt;a href=&quot;https://x.com/mudgen/status/1998024064430981595&quot;&gt;trademark demands&lt;/a&gt; against Nick Mudge, the author of ERC-2535.&lt;/p&gt;

&lt;p&gt;We want to get into the ethics and legality of this situation.&lt;/p&gt;

&lt;p&gt;First I want to see what is fair and reasonable and first let’s lay out a few facts:&lt;/p&gt;

&lt;h2 id=&quot;facts&quot;&gt;Facts&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;The Diamond Standard, Inc trademark goods description heavily mentions “blockchain” and “asset tracking”&lt;/li&gt;
  &lt;li&gt;A major (the only?) use case of smart contracts on blockchain is asset tracking (i.e. NFTs, value tokens)&lt;/li&gt;
  &lt;li&gt;ERC-2535 helps people write smart contracts and beautifully uses the word “diamond” to intuitively explain that&lt;/li&gt;
  &lt;li&gt;EIPs (ERCs) are defined as “standards” as per the EIP project homepage&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And I don’t know about when the first ERC-2535 discussions and implementations happened (we can see the main EIPs repo); and I don’t know when the first commercial use of the Diamond Standard, Inc product was or if that date is even relevant.&lt;/p&gt;

&lt;p&gt;But for the moment let’s assume that Diamond Standard, Inc has exclusive claim on using that name for their product.&lt;/p&gt;

&lt;h2 id=&quot;synthesis&quot;&gt;Synthesis&lt;/h2&gt;

&lt;p&gt;Given these facts (and also understand that I am biased in asserting fact #2 above) let’s synthesize a few things.&lt;/p&gt;

&lt;p&gt;First, there is a real risk of confusion that ERC-2535 is related to Diamond Standard, Inc.&lt;/p&gt;

&lt;p&gt;Second, if ERC-2535 is going to try to use the name “Diamond []tandard” then the “s” should be lower case, as a descriptive word, and not as part of the name. (EIP editors may or may not allow this.) Or it should be omitted from the name at the top of the page and then any reference to it in the text should use a lower case “s”.&lt;/p&gt;

&lt;p&gt;Third, us personally, and anybody skilled in the arts, we all understand that ERC-2535 does not claim to, and does not actually, have anything specifically to “inventory management”, “asset exchange” or anything else claimed in the trademark.&lt;/p&gt;

&lt;p&gt;Fourth, for people not skilled in the arts, and who would never use actually ERC-2535, if those people are uncritically listening to arguments from lawyers, they could be convinced that there is infringement.&lt;/p&gt;

&lt;p&gt;Fifth, (whether legally required or not) we should want to conduct ourselves in a way that makes sense in front of our peers, but also in front of lay people.&lt;/p&gt;

&lt;p&gt;Now therefore I think that in addition to not using a capital “s”, Diamond Standard, Inc should be entitled to demand that ERC-2535 will include a disclaimer “is not related to or endorsed by Diamond Standard Inc., a Delaware corporation” only if ERC-2535 is using the word “standard” next to the word “Diamond” anywhere in its main document or surrounding. EIP editors may or may not allow this.&lt;/p&gt;

&lt;p&gt;And then of course, if Diamond Standard, Inc demands that ERC-2535 stop using the word “standard” next to “Diamond” entirely, then we will all know this is overreach for spite and serving no legitimate business purpose.&lt;/p&gt;

&lt;p&gt;And I say that if ERC-2535 will want to continue using the capital letter “S” standard in its name, then it is willingly allowing confusion. Even though we all know this confusion is only among people that have nothing to do with ERC-2535 or Diamond Standard, Inc. customers.&lt;/p&gt;

&lt;p&gt;And of course EIP editors are fully within their rights to reject any mention of trademarks and outside entities in EIPs. (Especially if &lt;a href=&quot;https://eips.ethereum.org/EIPS/eip-7848&quot;&gt;the EIP&lt;/a&gt; criticizes how Ethereum Foundation itself uses its trademark!)&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Let’s get along.&lt;/p&gt;

&lt;p&gt;Let’s support &lt;em&gt;ERC-2535 Diamond standard&lt;/em&gt; or &lt;em&gt;ERC-2535 Diamond contracts&lt;/em&gt; or &lt;em&gt;ERC-2535 Diamonds&lt;/em&gt;. And also I’d love to see the Diamond Standard, Inc. product in action and see how that project can be successful too.&lt;/p&gt;
</description>
        <pubDate>Mon, 08 Dec 2025 00:00:00 +0000</pubDate>
        <link>https://blog.phor.net/erc-2535-and-diamond-standard-inc</link>
        <guid isPermaLink="true">https://blog.phor.net/erc-2535-and-diamond-standard-inc</guid>
        
        <category>blockchain</category>
        
        
      </item>
    
      <item>
        <title>I sat down with the new SEC Crypto Task Force, they are legit</title>
        <description>&lt;p&gt;&lt;em&gt;After years of silence, a game-changing crypto meeting.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As the lead author of ERC-721 (the standard powering NFTs) and someone who’s presented to regulators and central banks across EMEA, China, and beyond, I’ve spent years navigating the global crypto regulatory landscape. But in the US, it was always a dead end: ghosted emails, unclear jurisdictions, and outright antagonism that drove innovation offshore. That changed dramatically with the new SEC Crypto Task Force. I just sat down with them, and they are legit—collaborative, knowledgeable and genuinely invested in making American crypto thrive.&lt;/p&gt;

&lt;p&gt;Sharing here my experience, how this went versus my prior experiences trying to engage the US government regarding crypto projects and how you can connect.&lt;/p&gt;

&lt;h2 id=&quot;the-old-us-crypto-nightmare-vs-the-new-hope&quot;&gt;The old US crypto nightmare vs. the new hope&lt;/h2&gt;

&lt;p&gt;US regulators have historically been inaccessible and unhelpful compared to their international counterparts. In Europe, the Middle East, Africa, and even China, I’ve participated in productive policy roundtables and presentations that led to real progress: reasonable crypto regulations worldwide, NFTs exempted from securities laws in most places, and China’s national and Shanghai governments targeting NFTs for investment in their 14th Five-Year Plan.&lt;/p&gt;

&lt;p&gt;This regulatory arbitrage forced projects offshore, costing the US jobs, tax revenue and its edge in blockchain innovation. This all made the US everybody’s last choice for deploying new fintech/crypto projects.&lt;/p&gt;

&lt;p&gt;Then Donald Trump took office as the 47th president, and everything shifted. The SEC Crypto Task Force was announced hours after his inauguration on January 20, 2025, led by Commissioner Hester M. Peirce, &lt;a href=&quot;https://www.sec.gov/files/crypto-task-force-designation-letter.pdf&quot;&gt;first announced 2025-01-25&lt;/a&gt;. My personal experience with them gives me real hope: this could be the inflection point where US policy catches up, fostering collaborative, common-sense regulation that to help the US catch pace.&lt;/p&gt;

&lt;h2 id=&quot;how-it-went&quot;&gt;How it went&lt;/h2&gt;

&lt;p&gt;Our meeting was 2025-06-10, with the option to meet in-person or online. They allocated up to 50 minutes to meet and we were allowed to send detailed documents ahead of time. Overall our meeting was less than 40 minutes, barely a lunch break, but it was very productive.&lt;/p&gt;

&lt;p class=&quot;margin-note&quot;&gt;This is the holy grail crypto project.&lt;/p&gt;

&lt;p&gt;I had started by presenting &lt;a href=&quot;https://www.sec.gov/files/ctf-memo-tokenco-wm-entriken-design-blockchain-technology-061015.pdf&quot;&gt;a half-cooked, very basic crypto project&lt;/a&gt;. In the world of US crypto regulation, there is a strong determinant “did your entity facilitate the transaction / or was the transaction processed by disinterested automata?” And basically, I leaned on that classification hard to see if I could legally start a business that holds shares of private companies and creates crypto tokens… all without registering as a broker-dealer.&lt;/p&gt;

&lt;p&gt;As we went through the project, I was very open about what we are trying to do–avoiding the broker-dealer registration, doing the minimum necessary tasks to comply with rules. And we went through scenarios in rapid succession. (“What if we added a bunch of stuff so that this is not the primary business operation?” “What if we remove that part, is that germane to this meeting the test?”) And the SEC team was super helpful in telling us which parts of which rules we were brushing up against. (“See where the ‘40 act says….” “That sounds more like a security-based swap if you do it that way.”)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It was like walking into a room of experienced entrepreneurs, and doing back-of-the-napkin planning with them… the best collaboration you can get!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At the end of the session, we clocked in under 40 minutes. We ended the call early. No need to discuss further once we got through everything. And they did appreciate this. I left with plenty of homework, references and other projects to study.&lt;/p&gt;

&lt;p&gt;The task force did not hesitate in answering questions from all directions. They brought their own ideas I was not even thinking about.&lt;/p&gt;

&lt;p&gt;I had asked about upcoming regulations (released, but not yet effective), recently passed law and even laws on the hill (i.e. voted but not signed, in committee). The Crypto Task Force had no problem talking about these and being as helpful as possible.&lt;/p&gt;

&lt;h2 id=&quot;the-new-crypto-government-vs-before&quot;&gt;The new crypto government vs. before&lt;/h2&gt;

&lt;p&gt;One can’t help but notice that the SEC Crypto Task Force was stood up hours after Donald Trump’s inauguration as the 47th president of the United States.&lt;/p&gt;

&lt;p&gt;During years prior, I have done &lt;a href=&quot;https://phor.net/#speaking&quot;&gt;policy roundtables and presentations&lt;/a&gt; across EMEA and China. They have been very welcoming and productive. And the end result of this is:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;We have reasonable crypto regulations in most of the world.&lt;/li&gt;
  &lt;li&gt;NFTs are exempt from securities regulations in most of the world.&lt;/li&gt;
  &lt;li&gt;China’s &lt;a href=&quot;https://www.shanghai.gov.cn/hfbf2022/20220712/d3f5206dec5f4010a6065b4aa2c1ccce.html?eqid=9be3d5c80000cfcb00000006647d875f&quot;&gt;Shanghai&lt;/a&gt; and &lt;a href=&quot;https://www.spp.gov.cn/spp/llyj/202305/t20230515_614042.shtml&quot;&gt;national government&lt;/a&gt; included NFTs as a targeted investment and study area for their 14th Five-Year Plan (十四五).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;During the same time in the US, I was able to collaborate with NIST &lt;a href=&quot;https://nvlpubs.nist.gov/nistpubs/ir/2021/NIST.IR.8301.pdf&quot;&gt;on a paper&lt;/a&gt; and meet with the &lt;a href=&quot;https://www.philadelphiafed.org/&quot;&gt;Philadelphia Federal Reserve Bank&lt;/a&gt;. But when I tried to connect with the SEC and the CFTC (through LabCFTC, CFTC2.0), I got nothing. Internally, they were not clear on who regulated what.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;US regulators under prior leadership treated crypto with outright hostility, stifling domestic growth.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the US, the difference is night and day. With the “day” starting 2025-01-20.&lt;/p&gt;

&lt;h2 id=&quot;outcome&quot;&gt;Outcome&lt;/h2&gt;

&lt;p&gt;We have a path forward, and I think it will be possible to operate a crypto business, doing interesting things, legally in the US. I estimate we will not need to resort to “near-shore” operations like how OpenSea launched the OpenSea Foundation in the Cayman Islands to create a SEA token or how Robinhood launched its USDG stablecoin initially from Singapore and its Stock Tokens under Lithuania jurisdiction.&lt;/p&gt;

&lt;p&gt;Related: see also where &lt;a href=&quot;https://www.youtube.com/watch?v=7LoMoqltRzM&quot;&gt;I interview regional officials&lt;/a&gt;, including Matis Mäeker, about Lithuania anti-money laundering on crypto.&lt;/p&gt;

&lt;p&gt;I’m working hard to do business in the US, and do it legally. Don’t let the US fall behind on innovation. This point was not lost on the Task Force team, and we are all together in a make-or-break time.&lt;/p&gt;

&lt;h2 id=&quot;how-you-can-connect&quot;&gt;How you can connect&lt;/h2&gt;

&lt;p&gt;First, have a serious project, not just a whitepaper. Have counsel. Be prepared to discuss your project in detail. If you have already considered to do business “near-shore” instead of in the US, bring your notes from that analysis.&lt;/p&gt;

&lt;p&gt;You can bring counsel to your meeting, or you can bring your executives or your business
development team.&lt;/p&gt;

&lt;p&gt;Use the &lt;a href=&quot;https://www.sec.gov/about/crypto-task-force/meeting-request&quot;&gt;SEC Crypto Task Force official meeting request form&lt;/a&gt; and prepare all your documents.&lt;/p&gt;

&lt;p&gt;I was able to secure our first meeting within two weeks of reaching out.&lt;/p&gt;

&lt;h2 id=&quot;special-thanks&quot;&gt;Special thanks&lt;/h2&gt;

&lt;p&gt;Shoutout to the task force team who made this possible. Here is who they invited to the meeting:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Ileana Ciobanu: &lt;a href=&quot;https://www.sec.gov/files/finl-mgmt-ltr-review-sec-controls-over-public-comments-submitted-online-and-actions-taken-response.pdf&quot;&gt;senior special counsel, Office of the Chief Counsel to the CIO&lt;/a&gt;;
&lt;a href=&quot;https://www.sec.gov/files/finl-mgmt-ltr-review-sec-controls-over-public-comments-submitted-online-and-actions-taken-response.pdf&quot;&gt;senior special counsel, Office of Information Technology&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Andrew Schoeffler: &lt;a href=&quot;https://www.sec.gov/newsroom/press-releases/2025-49&quot;&gt;senior advisor, Crypto Task Force&lt;/a&gt;; &lt;a href=&quot;https://www.federalregister.gov/documents/2017/06/13/2017-12140/commission-statement-concerning-a-request-for-an-interpretation-as-to-whether-a-particular-agreement&quot;&gt;special counsel&lt;/a&gt;, &lt;a href=&quot;https://www.sec.gov/newsroom/press-releases/2016-216&quot;&gt;Division of Corporation Finance&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Landon Zinda: &lt;a href=&quot;https://www.sec.gov/newsroom/press-releases/2025-36&quot;&gt;senior advisor, Crypto Task Force&lt;/a&gt;; &lt;a href=&quot;https://www.sec.gov/newsroom/press-releases/2025-36&quot;&gt;counsel to the acting chairman&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Veronica Reynolds: (&lt;a href=&quot;https://www.sec.gov/newsroom/press-releases/2025-49&quot;&gt;senior advisor, Crypto Task Force&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;Robert J. Teply: &lt;a href=&quot;https://www.sec.gov/newsroom/press-releases/2025-49&quot;&gt;senior advisor, Crypto Task Force&lt;/a&gt;; &lt;a href=&quot;https://www.sec.gov/newsroom/speeches-statements/gensler-statement-electronic-filing-121624&quot;&gt;Office of the General Counsel&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Sumeera Younis: &lt;a href=&quot;https://www.sec.gov/newsroom/press-releases/2025-49&quot;&gt;chief of operations, Crypto Task Force&lt;/a&gt;; &lt;a href=&quot;https://www.sec.gov/comments/s7-12-23/s71223-283281-691802.pdf&quot;&gt;counsel to commissioner&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Laura Powell: &lt;a href=&quot;https://www.sec.gov/newsroom/press-releases/2025-49&quot;&gt;senior advisor, Crypto Task Force&lt;/a&gt;; &lt;a href=&quot;https://www.sec.gov/comments/s7-04-23/s70423-20161923-330757.pdf&quot;&gt;senior counsel&lt;/a&gt;, &lt;a href=&quot;https://www.sec.gov/comments/s7-04-23/s70423-204603-411523.pdf&quot;&gt;Division of Economic and Risk Analysis&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Michael Selig: &lt;a href=&quot;https://www.sec.gov/newsroom/press-releases/2025-49&quot;&gt;chief counsel, Crypto Task Force&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Wed, 16 Jul 2025 00:00:00 +0000</pubDate>
        <link>https://blog.phor.net/sec-crypto-task-force</link>
        <guid isPermaLink="true">https://blog.phor.net/sec-crypto-task-force</guid>
        
        <category>blockchain</category>
        
        
      </item>
    
      <item>
        <title>Affiliate link anything</title>
        <description>&lt;p&gt;Paste any product link here to turn it into an affiliate link that pays me a commission.&lt;/p&gt;

&lt;p&gt;&lt;input id=&quot;affiliate-link&quot; type=&quot;text&quot; style=&quot;width: 100%; height: 3em; font-size: 1.5em;&quot; placeholder=&quot;Paste a product link here&quot; /&gt;&lt;/p&gt;

&lt;p id=&quot;affiliate-link-results&quot;&gt;(After you paste a link above, the affiliate link will appear here.)&lt;/p&gt;

&lt;script&gt;
document.getElementById(&quot;affiliate-link&quot;).addEventListener(&quot;input&quot;, function() {
    const inputUrl = document.getElementById(&quot;affiliate-link&quot;).value.trim();
    const resultsElement = document.getElementById(&quot;affiliate-link-results&quot;);

    // Clear results if input is empty
    if (!inputUrl) {
        resultsElement.innerHTML = &quot;&quot;;
        return;
    }

    // Try to parse the input as a valid URL
    let url;
    try {
        url = new URL(inputUrl);
    } catch (e) {
        resultsElement.innerHTML = &quot;&lt;span style=&apos;color: red;&apos;&gt;Invalid URL format. Please enter a valid Amazon link.&lt;/span&gt;&quot;;
        return;
    }

    // Check if it&apos;s an Amazon domain
    const amazonDomains = /\.(com|co\.uk|ca|de|fr|it|es|in|jp)$/i;
    if (!url.hostname.match(/^(www\.)?amazon\./i) || !url.hostname.match(amazonDomains)) {
        resultsElement.innerHTML = &quot;&lt;span style=&apos;color: red;&apos;&gt;Not an Amazon link. Please provide a valid Amazon URL.&lt;/span&gt;&quot;;
        return;
    }

    // Extract ASIN for product pages
    const asinRegex = /\/(?:dp|gp\/product)\/([A-Z0-9]{10})(?:[\/?#]|$)/i;
    const asinMatch = inputUrl.match(asinRegex);

    if (asinMatch) {
        const asin = asinMatch[1];
        const affiliateLink = `https://www.amazon.com/gp/product/${asin}?tag=phor-20`;
        resultsElement.innerHTML = `&lt;a href=&quot;${affiliateLink}&quot; target=&quot;_blank&quot;&gt;${affiliateLink}&lt;/a&gt;`;
    } else {
        // Handle non-product pages (e.g., category, search, deals)
        const isAmazonPage = url.pathname.match(/^(\/(?:s|b|deal|g|top-rated|best-sellers)\/?)/i);
        if (isAmazonPage || url.search) { // Search or category pages often have query params
            const affiliateLink = `${inputUrl}${inputUrl.includes(&quot;?&quot;) ? &quot;&amp;&quot; : &quot;?&quot;}tag=phor-20`;
            resultsElement.innerHTML = `&lt;a href=&quot;${affiliateLink}&quot; target=&quot;_blank&quot;&gt;${affiliateLink}&lt;/a&gt;`;
        } else {
            resultsElement.innerHTML = &quot;&lt;span style=&apos;color: red;&apos;&gt;Could not generate affiliate link. Ensure it’s a valid Amazon product or page.&lt;/span&gt;&quot;;
        }
    }
});
&lt;/script&gt;

</description>
        <pubDate>Mon, 03 Mar 2025 00:00:00 +0000</pubDate>
        <link>https://blog.phor.net/affiliate-anything</link>
        <guid isPermaLink="true">https://blog.phor.net/affiliate-anything</guid>
        
        <category>my-life</category>
        
        
      </item>
    
      <item>
        <title>Is half the food you eat illegal in Europe?</title>
        <description>&lt;p&gt;I randomly picked up several food products off the shelf in Whole Foods and Trader Joe’s to see if those foods would be banned in Europe. This is way harder than you might think, and you won’t believe the results.&lt;/p&gt;

&lt;h2 id=&quot;why-check&quot;&gt;Why check?&lt;/h2&gt;

&lt;p&gt;My research is inspired by Dr. Daniel Pompa’s &lt;a href=&quot;https://www.youtube.com/shorts/OFIU1i6tmUI&quot;&gt;video in Costco&lt;/a&gt; where he claims every food product in the candy aisle is illegal in Europe.&lt;/p&gt;

&lt;p&gt;I’ve heard the claim “half of the foods in the US are illegal in Europe” recently on the Tucker Carlson podcast, and many years ago from Bernie Sanders. But did not hear them cite specific evidence.&lt;/p&gt;

&lt;p&gt;Here is some evidence.&lt;/p&gt;

&lt;h2 id=&quot;methodology&quot;&gt;Methodology&lt;/h2&gt;

&lt;p&gt;My wife and I randomly picked up 5–10 products at Whole Foods and Trader Joe’s. We took photos of the UPC code and then I went home to research.&lt;/p&gt;

&lt;p&gt;First, many of these products would be banned specifically for labeling requirements. In the US you can say the ingredients include some emulsifier. But in EU you must include the E-ingredient number like E-164. I don’t consider this a worthwhile distinction and it has no effect on your health (unless you are specifically allergic to that thing, which you aren’t because allergens are a separate labeling requirement).&lt;/p&gt;

&lt;p&gt;This required more leg work than you might imagine. There is no EU database of allowed or disallowed food ingredients so you actually need to read laws and cross reference their scientific publications, which are cited from the laws.&lt;/p&gt;

&lt;p class=&quot;margin-note&quot;&gt;OpenRouter has a mode where you can talk to multiple language models at once. You can also access these models on their own platforms.&lt;/p&gt;

&lt;p&gt;I also researched these by asking various language models: OpenAI o1, OpenAI o3-mini, Grok 2, Claude 3.5 Sonnet, Gemini Pro 1.5, Grok 2(1212), DeepSeek R3. They disagreed on the results. Even different models from the same company. This is sensitive to the knowledge cutoff date of the model and how creative they are versus citing hard facts.&lt;/p&gt;

&lt;h2 id=&quot;results&quot;&gt;Results&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Su went to Whole Foods and scanned random products
    &lt;ul&gt;
      &lt;li&gt;✅ 708971928841 Treehouse cookies
        &lt;ul&gt;
          &lt;li&gt;Polysorbate 60 E435 is legal&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;✅ 810165019171 YummyEarth&lt;/li&gt;
      &lt;li&gt;✅ 099482469542 Whole Foods ranch dressing&lt;/li&gt;
      &lt;li&gt;✅ 099482501235 Whole Foods ravioli&lt;/li&gt;
      &lt;li&gt;✅ 812541030176 Fitjoy Foods pretzels&lt;/li&gt;
      &lt;li&gt;✅ 815099021665 Chips&lt;/li&gt;
      &lt;li&gt;❌ 850020363339 Local Weather drink
        &lt;ul&gt;
          &lt;li&gt;Ashwagandha Root &lt;a href=&quot;https://ec.europa.eu/food/food-feed-portal/screen/novel-food-catalogue/search&quot;&gt;EU: not novel in food&lt;/a&gt;, &lt;a href=&quot;https://foedevarestyrelsen.dk/kost-og-foedevarer/alt-om-mad/kemi-i-maden/mad-med-uoensket-kemi/ashwagandha&quot;&gt;Illegal to sell as food in Denmark&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;❓ 769933857395 Lake Champlain chocolates
        &lt;ul&gt;
          &lt;li&gt;Coconut aminos seems like it should be banned as an unevaluated novel food without preauthorization in EU, but nobody has blogged about this yet&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Will went to Trader Joe’s and scanned random products
    &lt;ul&gt;
      &lt;li&gt;✅ Trader Joe’s vegan tikka masala&lt;/li&gt;
      &lt;li&gt;✅ SKU 00513241 Jingle Mingle&lt;/li&gt;
      &lt;li&gt;✅ SKU 0094 8890 Trade Joe’s Golden Round Crackers
        &lt;ul&gt;
          &lt;li&gt;The wheat enrichment has some country-level rules but I could not find a specific offense&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;✅ SKU 00761567 Trader Joe’s Multigrain crackers&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So we found one product that is illegal in (part of) Europe. And I think another one probably illegal, but I’m questioning myself because nobody else seems to have gotten to that conclusion yet. Both of them are from Whole Foods.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;I was surprised that Whole Foods (in the US) would have any foods that are illegal in Europe (ignoring labeling requirements).&lt;/p&gt;

&lt;p&gt;Looking up the legality of foods is very difficult. Europe has a centralized &lt;a href=&quot;https://ec.europa.eu/food/food-feed-portal/screen/food-additives/search&quot;&gt;additives database&lt;/a&gt;, a &lt;a href=&quot;https://ec.europa.eu/food/food-feed-portal/screen/novel-food-catalogue/search&quot;&gt;novel foods database&lt;/a&gt; and all the laws and regulations published. But cross referencing is non-existent.&lt;/p&gt;

&lt;p&gt;For example, looking up UV treated wine:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;According to the information available to Member States’ competent authorities, this product was not consumed in the EU to a significant degree as a food before 15 May 1997. Therefore, a pre-market authorisation in accordance with Regulation (EU) 2015/2283 is required before it can be placed as food on the EU market.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But it does not tell you whether any pre-market authorizations have been granted. And that leaves out the rule exceptions for certain food categories and regional exceptions.&lt;/p&gt;

&lt;h2 id=&quot;reader-circle-questions&quot;&gt;Reader circle questions&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Are there are specific foods you would like to research whether they are legal in Europe?&lt;/li&gt;
  &lt;li&gt;Do you or your kids have a reaction to some best selling foods?&lt;/li&gt;
  &lt;li&gt;How much do you care about understanding the food you put in your or your kids’ mouth?&lt;/li&gt;
  &lt;li&gt;Where do you think you could find many EU illegal foods in the US?&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Tue, 04 Feb 2025 00:00:00 +0000</pubDate>
        <link>https://blog.phor.net/half-your-food-illegal-in-europe</link>
        <guid isPermaLink="true">https://blog.phor.net/half-your-food-illegal-in-europe</guid>
        
        <category>research</category>
        
        <category>health</category>
        
        <category>food</category>
        
        
      </item>
    
      <item>
        <title>Google and Apple&apos;s updated default search agreement</title>
        <description>&lt;p class=&quot;margin-note&quot;&gt;United States v. Google, No. 20-cv-3010 (APM) (D.D.C. Aug. 5, 2024).&lt;/p&gt;

&lt;p&gt;In August 2024, the ruling came in the case of United States v. Google regarding the default search agreement between Google and Apple.&lt;/p&gt;

&lt;p&gt;Let’s take a quick look at how Google was found liable and the actual agreement. Then let’s see the new agreement they will switch to and what it means for you, someone that uses an iPhone.&lt;/p&gt;

&lt;h2 id=&quot;the-opinion-of-the-court&quot;&gt;The opinion of the court&lt;/h2&gt;

&lt;p&gt;Google was found liable in the court opinion. And although the ruling is 286 pages long, the conclusions of law, just the headings in the opinion, are very clear and tell a story you are probably already familiar with:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Google has monopoly power in the general search services market.&lt;/li&gt;
  &lt;li&gt;The [Apple] agreements are exclusive.&lt;/li&gt;
  &lt;li&gt;The exclusive agreements cause anticompetitive effects in the general search services market.&lt;/li&gt;
  &lt;li&gt;The exclusive agreements foreclose a substantial share of the market.&lt;/li&gt;
  &lt;li&gt;The exclusive agreements allow Google to profitably charge supracompetitive prices for text advertisements.&lt;/li&gt;
  &lt;li&gt;The exclusive agreements have allowed Google to degrade the quality of its text advertisements.&lt;/li&gt;
  &lt;li&gt;The exclusive agreements have capped rivals’ advertising revenue&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So basically the court just learned what human beings on Earth already knew for 10+ years. 😆&lt;/p&gt;

&lt;p&gt;And the legal conclusion:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Google has violated Section 2 of the Sherman Act by maintaining its monopoly in two product markets in the United States—general search services and general text advertising—through its exclusive distribution agreements.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So let’s look at this agreement.&lt;/p&gt;

&lt;h2 id=&quot;the-agreement&quot;&gt;The agreement&lt;/h2&gt;

&lt;p&gt;Looking just at the agreement with Apple, Google is the default search engine for Safari on iOS. And additionally, Apple agrees not to make a competing product on its own. Google pays Apple on the basis of a revenue share agreement. In 2021 this was over $26 billion.&lt;/p&gt;

&lt;p&gt;Google has replicated this agreement with other partners. And the conclusion is that “most devices in the United States come preloaded exclusively with Google”.&lt;/p&gt;

&lt;p&gt;So basically it’s a joint venture that Apple wittingly joined. There are probably many causes of action to bring liability to Apple too.&lt;/p&gt;

&lt;p&gt;So Apple, as well as Google, should be motivated to find a new agreement. Obviously just ending the agreement is not preferred. $26 billion gravy trains are hard to derail.&lt;/p&gt;

&lt;h2 id=&quot;the-new-agreement&quot;&gt;The new agreement&lt;/h2&gt;

&lt;p&gt;The new agreement is so simple, you’ll be surprised Apple didn’t launch with this first. Let’s compare.&lt;/p&gt;

&lt;p&gt;It is an agreement between the search engine and the platform (e.g. Apple).&lt;/p&gt;

&lt;table class=&quot;table&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Old agreement&lt;/th&gt;
      &lt;th&gt;New agreement&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Default search for X% of traffic&lt;/td&gt;
      &lt;td&gt;Default search for X% of traffic or for Y visitors&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Exclusive agreement&lt;/td&gt;
      &lt;td&gt;Other people can bid too&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Revenue share&lt;/td&gt;
      &lt;td&gt;Price per percentage point of traffic or per visitor&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Platform must not make a competing product&lt;/td&gt;
      &lt;td&gt;Lol, no&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Agreement lasts 20 years&lt;/td&gt;
      &lt;td&gt;Agreement lasts 1 month&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;In other words, the new agreement is a discriminatory auction or a Dutch auction.&lt;/p&gt;

&lt;p&gt;So if Google bids 3¢ per query and wants to buy all of them, but DuckDuckGo bids 4¢ per query for up to 10% of the queries, then DuckDuckGo will get 10% of the queries and Google will get the rest. And the deal resets every month.&lt;/p&gt;

&lt;p&gt;This allows Apple to maximize revenue. It allows DuckDuckGo to purchase some traffic. And it allows Apple to build a search engine if they want to.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2024-09-15-google-apple-updated-search-agreement.webp&quot; alt=&quot;Contract changes&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;how-it-effects-you&quot;&gt;How it effects you&lt;/h2&gt;

&lt;p&gt;As somebody who uses an iPhone and who never changes their default search engine, you will see once in a while see a duck at the top of your page instead of a G.&lt;/p&gt;

&lt;p&gt;The remedies court case hasn’t even started yet, and Apple hasn’t read this proposal yet. So you can expect this in the year 2035 or later.&lt;/p&gt;
</description>
        <pubDate>Sun, 15 Sep 2024 00:00:00 +0000</pubDate>
        <link>https://blog.phor.net/google-apple-updated-search-agreement</link>
        <guid isPermaLink="true">https://blog.phor.net/google-apple-updated-search-agreement</guid>
        
        <category>business</category>
        
        <category>game-theory</category>
        
        
      </item>
    
      <item>
        <title>Package manager package manager package manager</title>
        <description>&lt;p&gt;Let’s pretend I’ve decided to manage my JavaScript projects with package managers.&lt;/p&gt;

&lt;p&gt;I’ve done some programming projects before, and I think I have a pretty good idea of what I need: Node.js, a simple package manager, maybe &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yarn&lt;/code&gt;, or something like that.&lt;/p&gt;

&lt;p&gt;If I were going to manage multiple large-scale projects, rather than just a small app, I’d still need a package manager to handle dependencies, versioning, and scripts (among other things).&lt;/p&gt;

&lt;p&gt;So, I go to the Node.js documentation to find out which package manager I should use, and I ask the community, “Hey, which package manager should I start with?”&lt;/p&gt;

&lt;p&gt;“&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm&lt;/code&gt;?” someone asks. “Well, that’s kind of old-fashioned now.”&lt;/p&gt;

&lt;p&gt;Surprised, I ask why.&lt;/p&gt;

&lt;p&gt;“Well, the problem with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm&lt;/code&gt; is that it’s quite basic. You install a package, but it doesn’t have the fancy features some people need for complex projects. What if you later decide you need better caching, multiple workspaces, or more advanced dependency management? You’d need to switch to a different package manager.”&lt;/p&gt;

&lt;p&gt;“Hmmmmmm. Well, I suppose that makes sense. So what should I use?”&lt;/p&gt;

&lt;p&gt;“Try &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yarn&lt;/code&gt;,” they suggest. “It’s got lots of extra features, better speed, and supports workspaces.”&lt;/p&gt;

&lt;p&gt;“Okay, sounds great. Where do I get &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yarn&lt;/code&gt;?”&lt;/p&gt;

&lt;p&gt;“Actually, we don’t recommend regular &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yarn&lt;/code&gt; anymore. Now there’s Yarn Berry!”&lt;/p&gt;

&lt;p&gt;“Yarn Berry? What’s that?”&lt;/p&gt;

&lt;p&gt;“Yarn Berry is a package manager &lt;em&gt;package manager&lt;/em&gt;! Not only does it handle all your dependencies, but it also allows you to install multiple versions of itself. It’s faster, stricter with dependencies, and gives you a whole new level of control.”&lt;/p&gt;

&lt;p&gt;“So, it’s the new standard?”&lt;/p&gt;

&lt;p&gt;“Well… it’s a bit more complex, and not all tools support it yet. Plus, it comes with its own new configuration files, plugins, and sometimes requires a custom shell.”&lt;/p&gt;

&lt;p&gt;“That sounds… a bit much.”&lt;/p&gt;

&lt;p&gt;“Actually, managing multiple versions of a package manager with a package manager isn’t for everyone. So, now we have &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;corepack&lt;/code&gt;.”&lt;/p&gt;

&lt;p&gt;“Corepack? What’s that?”&lt;/p&gt;

&lt;p&gt;“Corepack is a &lt;strong&gt;package manager package manager package manager&lt;/strong&gt;. It allows you to manage different package manager package managers like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yarn&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pnpm&lt;/code&gt;. With &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;corepack&lt;/code&gt;, you get ultimate flexibility for all your package manager needs.”&lt;/p&gt;

&lt;p&gt;“So, where do I find &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;corepack&lt;/code&gt;?”&lt;/p&gt;

&lt;p&gt;“It’s bundled with Node.js now, but you still need to manually enable it and configure it to choose the right package manager package manager for each of your projects.”&lt;/p&gt;

&lt;p&gt;“I see…”&lt;/p&gt;

&lt;p&gt;“But wait! Managing a package manager package manager package manager is too much hassle for many users. So, what you really need is a version manager for Node.js itself. That’s where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvm&lt;/code&gt; comes in.”&lt;/p&gt;

&lt;p&gt;“But I just wanted to install a few packages for my project…”&lt;/p&gt;

&lt;p&gt;“Don’t worry! &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvm&lt;/code&gt; is a version manager for Node.js, which allows you to switch between different versions of Node.js. It’s essential for managing your Node.js environment. You’ll need to set it up in your shell, and it you will run it every time you switch directories.”&lt;/p&gt;

&lt;p&gt;“So, no simple package managers at all?”&lt;/p&gt;

&lt;p&gt;“Nope! If you want to manage a modern JavaScript project, you desperately need something more advanced than a simple package manager.”&lt;/p&gt;

&lt;p&gt;“And everyone is doing it this way?”&lt;/p&gt;

&lt;p&gt;“Absolutely.”&lt;/p&gt;

&lt;p&gt;“Well… all right. If this is the way things are done now, I guess I’d better learn how to do it.”&lt;/p&gt;

&lt;p&gt;“Great attitude! Just don’t forget to start by reading all the GitHub issues, even the closed ones.”&lt;/p&gt;

&lt;p&gt;“This thing comes with documentation, right?”&lt;/p&gt;
</description>
        <pubDate>Sun, 08 Sep 2024 00:00:00 +0000</pubDate>
        <link>https://blog.phor.net/package-manager-package-manager-package-manager</link>
        <guid isPermaLink="true">https://blog.phor.net/package-manager-package-manager-package-manager</guid>
        
        <category>humor</category>
        
        <category>programming</category>
        
        
      </item>
    
      <item>
        <title>Firefox zero-day: you can&apos;t leave this page (2)</title>
        <description>&lt;p&gt;This a 0-day announcement showing web pages can prevent visitors from navigating back away from their website.&lt;/p&gt;

&lt;h2 id=&quot;nature-of-bug&quot;&gt;Nature of bug&lt;/h2&gt;

&lt;p&gt;Visitors cannot navigate back using the back button, the keyboard short cut for navigating, or dedicated mouse buttons/gestures for navigating back.&lt;/p&gt;

&lt;h2 id=&quot;affected-software&quot;&gt;Affected software&lt;/h2&gt;

&lt;p&gt;Firefox 129.0.1 64-bit on macOS and possibly more.&lt;/p&gt;

&lt;h2 id=&quot;steps-required&quot;&gt;Steps required&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Include this minimal snippet on a web page “B”:&lt;/p&gt;

    &lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;location.search||fetch(0).then(a=&amp;gt;location=&apos;?x&apos;);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Visit any other webpage “A”.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Access a link on “A” to the affected page “B”.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Attempt to navigate back to webpage “A”.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;tools-used-to-discover-bug&quot;&gt;Tools used to discover bug&lt;/h2&gt;

&lt;p&gt;This was found when creating a JavaScript snippet to handle redirects for a simple replacement for A/B tests that our team used to run with Google Optimize.&lt;/p&gt;

&lt;h2 id=&quot;discussion&quot;&gt;Discussion&lt;/h2&gt;

&lt;p&gt;It appears that Firefox employs hueristics or other logic to allow back navigation even when a web page is doing redirects to prevent this.&lt;/p&gt;

&lt;p&gt;I found that the main effective element here in the minimal exploit code is the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;async&lt;/code&gt; function. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fetch&lt;/code&gt; function is effective for here, as well as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;crypto.subtle.digest&lt;/code&gt;. However some other &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;async&lt;/code&gt; functions that we tried did not exhibit the bug, such as the most straightforward &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;await Promise.resolve(true)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I also golfed the exploit, this may make it applicable in more contexts such as with user-generated content. Golfing is a team sport, so do share if you find a shorter vector!&lt;/p&gt;

&lt;h2 id=&quot;test-date&quot;&gt;Test date&lt;/h2&gt;

&lt;p&gt;August 2024&lt;/p&gt;

&lt;h2 id=&quot;disclosure-timeline&quot;&gt;Disclosure timeline&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;2024-07-24 Discovery&lt;/li&gt;
  &lt;li&gt;2024-08-01 &lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=1913514&quot;&gt;Disclosure&lt;/a&gt; to Firefox’s vendor Mozilla using Bugzilla&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Fri, 16 Aug 2024 00:00:00 +0000</pubDate>
        <link>https://blog.phor.net/firefox-zero-day-cant-leave-this-page-2</link>
        <guid isPermaLink="true">https://blog.phor.net/firefox-zero-day-cant-leave-this-page-2</guid>
        
        <category>zero-day</category>
        
        <category>security</category>
        
        
      </item>
    
  </channel>
</rss>