{
  "schemaVersion": 1,
  "videoId": "6PeLWTmMYnQ",
  "videoUrl": "https://www.youtube.com/watch?v=6PeLWTmMYnQ",
  "title": "The Callback Window",
  "speakerCredit": "Jochen Hoenicke",
  "programmeTalkId": "jochen-hoenicke",
  "language": "en",
  "captionType": "auto-generated",
  "humanAccuracyReviewed": false,
  "spokenAudioCompletenessVerified": false,
  "cueEndTimesAvailable": false,
  "source": {
    "provider": "YouTube",
    "method": "native browser transcript export",
    "sha256": "2b02fb589c4c9f48df4df3cf18f198f7b9dd3b20e7bb1aa2c9fee0354fd0230f",
    "exportedAt": "2026-11-16T07:43:14.229052+00:00"
  },
  "qualityCaveats": [
    "Names, organizations, technical terms, code and numbers may be misrecognized.",
    "Source wording and disfluencies are preserved; no editorial corrections were applied.",
    "Export contains whole-second cue starts only; cue ends and subsecond timing are unavailable.",
    "A full caption-track export does not establish that every spoken word is represented.",
    "Automatic YouTube captions; not human-verified against the audio."
  ],
  "timingValidation": {
    "first_cue_start_seconds": 0,
    "last_cue_start_seconds": 1243,
    "video_duration_seconds": 1245,
    "seconds_after_last_cue_start": 2,
    "cue_start_gaps_over_30_seconds": [],
    "boundary_check": "pass",
    "criterion": "first cue <=15 seconds; last cue start within 30 seconds of player duration, allowing 1-second precision",
    "meaning": "Timing plausibility only; silence/applause or source caption omissions require audio review."
  },
  "segments": [
    {
      "index": 0,
      "start_seconds": 0,
      "source_timestamp": "0:00",
      "end_seconds": null,
      "text": "corresponding market."
    },
    {
      "index": 1,
      "start_seconds": 2,
      "source_timestamp": "0:02",
      "end_seconds": null,
      "text": "And important here is losses are"
    },
    {
      "index": 2,
      "start_seconds": 4,
      "source_timestamp": "0:04",
      "end_seconds": null,
      "text": "isolated to a market. There can be it's"
    },
    {
      "index": 3,
      "start_seconds": 6,
      "source_timestamp": "0:06",
      "end_seconds": null,
      "text": "a lending protocol if one token"
    },
    {
      "index": 4,
      "start_seconds": 9,
      "source_timestamp": "0:09",
      "end_seconds": null,
      "text": "loses value,"
    },
    {
      "index": 5,
      "start_seconds": 10,
      "source_timestamp": "0:10",
      "end_seconds": null,
      "text": "then there are losses and you want to"
    },
    {
      "index": 6,
      "start_seconds": 14,
      "source_timestamp": "0:14",
      "end_seconds": null,
      "text": "um keep them"
    },
    {
      "index": 7,
      "start_seconds": 16,
      "source_timestamp": "0:16",
      "end_seconds": null,
      "text": "in the market."
    },
    {
      "index": 8,
      "start_seconds": 19,
      "source_timestamp": "0:19",
      "end_seconds": null,
      "text": "So"
    },
    {
      "index": 9,
      "start_seconds": 21,
      "source_timestamp": "0:21",
      "end_seconds": null,
      "text": "one important property that we wanted to"
    },
    {
      "index": 10,
      "start_seconds": 23,
      "source_timestamp": "0:23",
      "end_seconds": null,
      "text": "verify is that you cannot put yourself"
    },
    {
      "index": 11,
      "start_seconds": 25,
      "source_timestamp": "0:25",
      "end_seconds": null,
      "text": "into debt"
    },
    {
      "index": 12,
      "start_seconds": 27,
      "source_timestamp": "0:27",
      "end_seconds": null,
      "text": "without putting collateral in there. So"
    },
    {
      "index": 13,
      "start_seconds": 29,
      "source_timestamp": "0:29",
      "end_seconds": null,
      "text": "what we first did is we defined what is"
    },
    {
      "index": 14,
      "start_seconds": 32,
      "source_timestamp": "0:32",
      "end_seconds": null,
      "text": "the maximum debt that you can put in"
    },
    {
      "index": 15,
      "start_seconds": 33,
      "source_timestamp": "0:33",
      "end_seconds": null,
      "text": "there,"
    },
    {
      "index": 16,
      "start_seconds": 35,
      "source_timestamp": "0:35",
      "end_seconds": null,
      "text": "which is collateral times the price and"
    },
    {
      "index": 17,
      "start_seconds": 37,
      "source_timestamp": "0:37",
      "end_seconds": null,
      "text": "then you have to account for over"
    },
    {
      "index": 18,
      "start_seconds": 39,
      "source_timestamp": "0:39",
      "end_seconds": null,
      "text": "collateralization, which is the LTV, the"
    },
    {
      "index": 19,
      "start_seconds": 41,
      "source_timestamp": "0:41",
      "end_seconds": null,
      "text": "ratio at which liquidation starts. And"
    },
    {
      "index": 20,
      "start_seconds": 44,
      "source_timestamp": "0:44",
      "end_seconds": null,
      "text": "if you put in less debt than the maximum"
    },
    {
      "index": 21,
      "start_seconds": 47,
      "source_timestamp": "0:47",
      "end_seconds": null,
      "text": "debt, then you are healthy."
    },
    {
      "index": 22,
      "start_seconds": 49,
      "source_timestamp": "0:49",
      "end_seconds": null,
      "text": "And you can only be liquidated if you"
    },
    {
      "index": 23,
      "start_seconds": 51,
      "source_timestamp": "0:51",
      "end_seconds": null,
      "text": "are not healthy or past maturity."
    },
    {
      "index": 24,
      "start_seconds": 56,
      "source_timestamp": "0:56",
      "end_seconds": null,
      "text": "And uh yeah, as long as you are healthy,"
    },
    {
      "index": 25,
      "start_seconds": 58,
      "source_timestamp": "0:58",
      "end_seconds": null,
      "text": "there can be also no shortfall."
    },
    {
      "index": 26,
      "start_seconds": 61,
      "source_timestamp": "1:01",
      "end_seconds": null,
      "text": "Uh so there can't be bad debt because"
    },
    {
      "index": 27,
      "start_seconds": 63,
      "source_timestamp": "1:03",
      "end_seconds": null,
      "text": "the collateral is worth more."
    },
    {
      "index": 28,
      "start_seconds": 67,
      "source_timestamp": "1:07",
      "end_seconds": null,
      "text": "And the guarantee that we want to give"
    },
    {
      "index": 29,
      "start_seconds": 69,
      "source_timestamp": "1:09",
      "end_seconds": null,
      "text": "in the protocol is if you are healthy at"
    },
    {
      "index": 30,
      "start_seconds": 71,
      "source_timestamp": "1:11",
      "end_seconds": null,
      "text": "some point and you"
    },
    {
      "index": 31,
      "start_seconds": 73,
      "source_timestamp": "1:13",
      "end_seconds": null,
      "text": "do any trans uh action on the market,"
    },
    {
      "index": 32,
      "start_seconds": 75,
      "source_timestamp": "1:15",
      "end_seconds": null,
      "text": "you're still healthy afterwards."
    },
    {
      "index": 33,
      "start_seconds": 78,
      "source_timestamp": "1:18",
      "end_seconds": null,
      "text": "So you can't"
    },
    {
      "index": 34,
      "start_seconds": 79,
      "source_timestamp": "1:19",
      "end_seconds": null,
      "text": "for example make a debt uh without"
    },
    {
      "index": 35,
      "start_seconds": 82,
      "source_timestamp": "1:22",
      "end_seconds": null,
      "text": "putting in collateral."
    },
    {
      "index": 36,
      "start_seconds": 84,
      "source_timestamp": "1:24",
      "end_seconds": null,
      "text": "And also other people cannot"
    },
    {
      "index": 37,
      "start_seconds": 86,
      "source_timestamp": "1:26",
      "end_seconds": null,
      "text": "um make your position liquidatable."
    },
    {
      "index": 38,
      "start_seconds": 90,
      "source_timestamp": "1:30",
      "end_seconds": null,
      "text": "What we really want is that you that"
    },
    {
      "index": 39,
      "start_seconds": 93,
      "source_timestamp": "1:33",
      "end_seconds": null,
      "text": "there is no bad with debt without sudden"
    },
    {
      "index": 40,
      "start_seconds": 95,
      "source_timestamp": "1:35",
      "end_seconds": null,
      "text": "price movements. So the invariant is of"
    },
    {
      "index": 41,
      "start_seconds": 98,
      "source_timestamp": "1:38",
      "end_seconds": null,
      "text": "course not a real invariant. It can"
    },
    {
      "index": 42,
      "start_seconds": 100,
      "source_timestamp": "1:40",
      "end_seconds": null,
      "text": "happen that you get unhealthy by price"
    },
    {
      "index": 43,
      "start_seconds": 102,
      "source_timestamp": "1:42",
      "end_seconds": null,
      "text": "movement."
    },
    {
      "index": 44,
      "start_seconds": 103,
      "source_timestamp": "1:43",
      "end_seconds": null,
      "text": "So the assumption that we use to prove"
    },
    {
      "index": 45,
      "start_seconds": 105,
      "source_timestamp": "1:45",
      "end_seconds": null,
      "text": "this property is that the prices don't"
    },
    {
      "index": 46,
      "start_seconds": 107,
      "source_timestamp": "1:47",
      "end_seconds": null,
      "text": "change."
    },
    {
      "index": 47,
      "start_seconds": 109,
      "source_timestamp": "1:49",
      "end_seconds": null,
      "text": "So"
    },
    {
      "index": 48,
      "start_seconds": 110,
      "source_timestamp": "1:50",
      "end_seconds": null,
      "text": "here's how the protocol"
    },
    {
      "index": 49,
      "start_seconds": 113,
      "source_timestamp": "1:53",
      "end_seconds": null,
      "text": "the take function"
    },
    {
      "index": 50,
      "start_seconds": 115,
      "source_timestamp": "1:55",
      "end_seconds": null,
      "text": "works. It's a very simply"
    },
    {
      "index": 51,
      "start_seconds": 117,
      "source_timestamp": "1:57",
      "end_seconds": null,
      "text": "fied version."
    },
    {
      "index": 52,
      "start_seconds": 118,
      "source_timestamp": "1:58",
      "end_seconds": null,
      "text": "So they use the fry P pattern, you can"
    },
    {
      "index": 53,
      "start_seconds": 121,
      "source_timestamp": "2:01",
      "end_seconds": null,
      "text": "say is check, act, interact, and check"
    },
    {
      "index": 54,
      "start_seconds": 124,
      "source_timestamp": "2:04",
      "end_seconds": null,
      "text": "again."
    },
    {
      "index": 55,
      "start_seconds": 125,
      "source_timestamp": "2:05",
      "end_seconds": null,
      "text": "So at the beginning, you check that all"
    },
    {
      "index": 56,
      "start_seconds": 127,
      "source_timestamp": "2:07",
      "end_seconds": null,
      "text": "the preconditions are true, that the"
    },
    {
      "index": 57,
      "start_seconds": 130,
      "source_timestamp": "2:10",
      "end_seconds": null,
      "text": "offer is still valid. Then you do the"
    },
    {
      "index": 58,
      "start_seconds": 133,
      "source_timestamp": "2:13",
      "end_seconds": null,
      "text": "actions. You change the credit and the"
    },
    {
      "index": 59,
      "start_seconds": 134,
      "source_timestamp": "2:14",
      "end_seconds": null,
      "text": "debt."
    },
    {
      "index": 60,
      "start_seconds": 135,
      "source_timestamp": "2:15",
      "end_seconds": null,
      "text": "Then there is interaction with other"
    },
    {
      "index": 61,
      "start_seconds": 137,
      "source_timestamp": "2:17",
      "end_seconds": null,
      "text": "protocols, so you transfer the tokens"
    },
    {
      "index": 62,
      "start_seconds": 141,
      "source_timestamp": "2:21",
      "end_seconds": null,
      "text": "and you can all There's also some"
    },
    {
      "index": 63,
      "start_seconds": 142,
      "source_timestamp": "2:22",
      "end_seconds": null,
      "text": "callbacks because this is an order book."
    },
    {
      "index": 64,
      "start_seconds": 145,
      "source_timestamp": "2:25",
      "end_seconds": null,
      "text": "And the"
    },
    {
      "index": 65,
      "start_seconds": 147,
      "source_timestamp": "2:27",
      "end_seconds": null,
      "text": "other person, the maker, could"
    },
    {
      "index": 66,
      "start_seconds": 149,
      "source_timestamp": "2:29",
      "end_seconds": null,
      "text": "have put the order long ago, and he"
    },
    {
      "index": 67,
      "start_seconds": 151,
      "source_timestamp": "2:31",
      "end_seconds": null,
      "text": "didn't put in the collateral because he"
    },
    {
      "index": 68,
      "start_seconds": 153,
      "source_timestamp": "2:33",
      "end_seconds": null,
      "text": "didn't put the debt."
    },
    {
      "index": 69,
      "start_seconds": 155,
      "source_timestamp": "2:35",
      "end_seconds": null,
      "text": "So this is the time where the"
    },
    {
      "index": 70,
      "start_seconds": 159,
      "source_timestamp": "2:39",
      "end_seconds": null,
      "text": "where the maker can react to your taking"
    },
    {
      "index": 71,
      "start_seconds": 162,
      "source_timestamp": "2:42",
      "end_seconds": null,
      "text": "offer and"
    },
    {
      "index": 72,
      "start_seconds": 163,
      "source_timestamp": "2:43",
      "end_seconds": null,
      "text": "actually put in the collateral."
    },
    {
      "index": 73,
      "start_seconds": 166,
      "source_timestamp": "2:46",
      "end_seconds": null,
      "text": "So in the on-sell,"
    },
    {
      "index": 74,
      "start_seconds": 168,
      "source_timestamp": "2:48",
      "end_seconds": null,
      "text": "this is important in this talk. You can"
    },
    {
      "index": 75,
      "start_seconds": 170,
      "source_timestamp": "2:50",
      "end_seconds": null,
      "text": "add the collateral."
    },
    {
      "index": 76,
      "start_seconds": 171,
      "source_timestamp": "2:51",
      "end_seconds": null,
      "text": "And"
    },
    {
      "index": 77,
      "start_seconds": 173,
      "source_timestamp": "2:53",
      "end_seconds": null,
      "text": "yeah, you can even use the cash"
    },
    {
      "index": 78,
      "start_seconds": 175,
      "source_timestamp": "2:55",
      "end_seconds": null,
      "text": "that you get from selling your loan."
    },
    {
      "index": 79,
      "start_seconds": 179,
      "source_timestamp": "2:59",
      "end_seconds": null,
      "text": "And in the end, you check that the"
    },
    {
      "index": 80,
      "start_seconds": 180,
      "source_timestamp": "3:00",
      "end_seconds": null,
      "text": "protocol is healthy. So this is a"
    },
    {
      "index": 81,
      "start_seconds": 183,
      "source_timestamp": "3:03",
      "end_seconds": null,
      "text": "pipe part of the fry-p-pattern. You"
    },
    {
      "index": 82,
      "start_seconds": 185,
      "source_timestamp": "3:05",
      "end_seconds": null,
      "text": "check again."
    },
    {
      "index": 83,
      "start_seconds": 187,
      "source_timestamp": "3:07",
      "end_seconds": null,
      "text": "And you only check the healthiness at"
    },
    {
      "index": 84,
      "start_seconds": 189,
      "source_timestamp": "3:09",
      "end_seconds": null,
      "text": "the end."
    },
    {
      "index": 85,
      "start_seconds": 191,
      "source_timestamp": "3:11",
      "end_seconds": null,
      "text": "And this is"
    },
    {
      "index": 86,
      "start_seconds": 193,
      "source_timestamp": "3:13",
      "end_seconds": null,
      "text": "safe because"
    },
    {
      "index": 87,
      "start_seconds": 195,
      "source_timestamp": "3:15",
      "end_seconds": null,
      "text": "you can't"
    },
    {
      "index": 88,
      "start_seconds": 196,
      "source_timestamp": "3:16",
      "end_seconds": null,
      "text": "go over this check. It's like a flash"
    },
    {
      "index": 89,
      "start_seconds": 198,
      "source_timestamp": "3:18",
      "end_seconds": null,
      "text": "loan. If you"
    },
    {
      "index": 90,
      "start_seconds": 199,
      "source_timestamp": "3:19",
      "end_seconds": null,
      "text": "don't be healthy at the end, then"
    },
    {
      "index": 91,
      "start_seconds": 203,
      "source_timestamp": "3:23",
      "end_seconds": null,
      "text": "the transaction reverts and you never"
    },
    {
      "index": 92,
      "start_seconds": 204,
      "source_timestamp": "3:24",
      "end_seconds": null,
      "text": "got the money in the first place."
    },
    {
      "index": 93,
      "start_seconds": 207,
      "source_timestamp": "3:27",
      "end_seconds": null,
      "text": "So during the on-sell, the borrower has"
    },
    {
      "index": 94,
      "start_seconds": 209,
      "source_timestamp": "3:29",
      "end_seconds": null,
      "text": "the cash, the debt, but he cannot run"
    },
    {
      "index": 95,
      "start_seconds": 212,
      "source_timestamp": "3:32",
      "end_seconds": null,
      "text": "with the cash because he has to exit"
    },
    {
      "index": 96,
      "start_seconds": 215,
      "source_timestamp": "3:35",
      "end_seconds": null,
      "text": "this function normally."
    },
    {
      "index": 97,
      "start_seconds": 219,
      "source_timestamp": "3:39",
      "end_seconds": null,
      "text": "So how do we prove health? We write an"
    },
    {
      "index": 98,
      "start_seconds": 221,
      "source_timestamp": "3:41",
      "end_seconds": null,
      "text": "invariant."
    },
    {
      "index": 99,
      "start_seconds": 222,
      "source_timestamp": "3:42",
      "end_seconds": null,
      "text": "So invariant means it suits all the"
    },
    {
      "index": 100,
      "start_seconds": 224,
      "source_timestamp": "3:44",
      "end_seconds": null,
      "text": "time."
    },
    {
      "index": 101,
      "start_seconds": 225,
      "source_timestamp": "3:45",
      "end_seconds": null,
      "text": "This is only true under the assumption"
    },
    {
      "index": 102,
      "start_seconds": 227,
      "source_timestamp": "3:47",
      "end_seconds": null,
      "text": "that the Oracle prices don't change."
    },
    {
      "index": 103,
      "start_seconds": 230,
      "source_timestamp": "3:50",
      "end_seconds": null,
      "text": "And what you write is invariant, and"
    },
    {
      "index": 104,
      "start_seconds": 231,
      "source_timestamp": "3:51",
      "end_seconds": null,
      "text": "what the prover checks is if the"
    },
    {
      "index": 105,
      "start_seconds": 234,
      "source_timestamp": "3:54",
      "end_seconds": null,
      "text": "user is healthy before any operation on"
    },
    {
      "index": 106,
      "start_seconds": 238,
      "source_timestamp": "3:58",
      "end_seconds": null,
      "text": "the contract, and you do the operation,"
    },
    {
      "index": 107,
      "start_seconds": 240,
      "source_timestamp": "4:00",
      "end_seconds": null,
      "text": "then the user is healthy afterwards."
    },
    {
      "index": 108,
      "start_seconds": 243,
      "source_timestamp": "4:03",
      "end_seconds": null,
      "text": "And if prove this, you know that after"
    },
    {
      "index": 109,
      "start_seconds": 244,
      "source_timestamp": "4:04",
      "end_seconds": null,
      "text": "every transaction the user is healthy."
    },
    {
      "index": 110,
      "start_seconds": 248,
      "source_timestamp": "4:08",
      "end_seconds": null,
      "text": "However, if you have these callbacks,"
    },
    {
      "index": 111,
      "start_seconds": 251,
      "source_timestamp": "4:11",
      "end_seconds": null,
      "text": "you also want to be reentrancy safe. So"
    },
    {
      "index": 112,
      "start_seconds": 253,
      "source_timestamp": "4:13",
      "end_seconds": null,
      "text": "what you also check is whether the"
    },
    {
      "index": 113,
      "start_seconds": 256,
      "source_timestamp": "4:16",
      "end_seconds": null,
      "text": "invariant holds at the callback time."
    },
    {
      "index": 114,
      "start_seconds": 259,
      "source_timestamp": "4:19",
      "end_seconds": null,
      "text": "And you do this by adding another"
    },
    {
      "index": 115,
      "start_seconds": 260,
      "source_timestamp": "4:20",
      "end_seconds": null,
      "text": "keyboard strong."
    },
    {
      "index": 116,
      "start_seconds": 262,
      "source_timestamp": "4:22",
      "end_seconds": null,
      "text": "And then the invariant is also checked"
    },
    {
      "index": 117,
      "start_seconds": 265,
      "source_timestamp": "4:25",
      "end_seconds": null,
      "text": "when you do an external call and the"
    },
    {
      "index": 118,
      "start_seconds": 267,
      "source_timestamp": "4:27",
      "end_seconds": null,
      "text": "external call is now uh checking the"
    },
    {
      "index": 119,
      "start_seconds": 270,
      "source_timestamp": "4:30",
      "end_seconds": null,
      "text": "healthiness, then it models basically"
    },
    {
      "index": 120,
      "start_seconds": 272,
      "source_timestamp": "4:32",
      "end_seconds": null,
      "text": "any interaction with the contract"
    },
    {
      "index": 121,
      "start_seconds": 274,
      "source_timestamp": "4:34",
      "end_seconds": null,
      "text": "by saying this havoc. This means every"
    },
    {
      "index": 122,
      "start_seconds": 276,
      "source_timestamp": "4:36",
      "end_seconds": null,
      "text": "variable can change and then you require"
    },
    {
      "index": 123,
      "start_seconds": 279,
      "source_timestamp": "4:39",
      "end_seconds": null,
      "text": "that uh the"
    },
    {
      "index": 124,
      "start_seconds": 280,
      "source_timestamp": "4:40",
      "end_seconds": null,
      "text": "protocol is healthy again with this"
    },
    {
      "index": 125,
      "start_seconds": 282,
      "source_timestamp": "4:42",
      "end_seconds": null,
      "text": "assumption that you only can interact"
    },
    {
      "index": 126,
      "start_seconds": 285,
      "source_timestamp": "4:45",
      "end_seconds": null,
      "text": "with the pro uh with with the contract"
    },
    {
      "index": 127,
      "start_seconds": 287,
      "source_timestamp": "4:47",
      "end_seconds": null,
      "text": "in a way that you stay healthy. So this"
    },
    {
      "index": 128,
      "start_seconds": 290,
      "source_timestamp": "4:50",
      "end_seconds": null,
      "text": "is an inductive argument that this"
    },
    {
      "index": 129,
      "start_seconds": 291,
      "source_timestamp": "4:51",
      "end_seconds": null,
      "text": "holds."
    },
    {
      "index": 130,
      "start_seconds": 293,
      "source_timestamp": "4:53",
      "end_seconds": null,
      "text": "So the strong invariant checks also at"
    },
    {
      "index": 131,
      "start_seconds": 296,
      "source_timestamp": "4:56",
      "end_seconds": null,
      "text": "the on by and the on cell time. And if"
    },
    {
      "index": 132,
      "start_seconds": 299,
      "source_timestamp": "4:59",
      "end_seconds": null,
      "text": "we check this with the Satori prover, we"
    },
    {
      "index": 133,
      "start_seconds": 301,
      "source_timestamp": "5:01",
      "end_seconds": null,
      "text": "get a contact sample."
    },
    {
      "index": 134,
      "start_seconds": 303,
      "source_timestamp": "5:03",
      "end_seconds": null,
      "text": "And uh the contact sample is basically"
    },
    {
      "index": 135,
      "start_seconds": 305,
      "source_timestamp": "5:05",
      "end_seconds": null,
      "text": "you make a loan."
    },
    {
      "index": 136,
      "start_seconds": 307,
      "source_timestamp": "5:07",
      "end_seconds": null,
      "text": "Your"
    },
    {
      "index": 137,
      "start_seconds": 308,
      "source_timestamp": "5:08",
      "end_seconds": null,
      "text": "on cell"
    },
    {
      "index": 138,
      "start_seconds": 309,
      "source_timestamp": "5:09",
      "end_seconds": null,
      "text": "is called"
    },
    {
      "index": 139,
      "start_seconds": 311,
      "source_timestamp": "5:11",
      "end_seconds": null,
      "text": "and the healthiness check is violated."
    },
    {
      "index": 140,
      "start_seconds": 316,
      "source_timestamp": "5:16",
      "end_seconds": null,
      "text": "So"
    },
    {
      "index": 141,
      "start_seconds": 317,
      "source_timestamp": "5:17",
      "end_seconds": null,
      "text": "this is by design of the protocol."
    },
    {
      "index": 142,
      "start_seconds": 320,
      "source_timestamp": "5:20",
      "end_seconds": null,
      "text": "So in the on cell callback you want to"
    },
    {
      "index": 143,
      "start_seconds": 323,
      "source_timestamp": "5:23",
      "end_seconds": null,
      "text": "be unhealthy because this is the time"
    },
    {
      "index": 144,
      "start_seconds": 324,
      "source_timestamp": "5:24",
      "end_seconds": null,
      "text": "where you put in the collateral to"
    },
    {
      "index": 145,
      "start_seconds": 327,
      "source_timestamp": "5:27",
      "end_seconds": null,
      "text": "fulfill the healthiness check at the"
    },
    {
      "index": 146,
      "start_seconds": 328,
      "source_timestamp": "5:28",
      "end_seconds": null,
      "text": "end."
    },
    {
      "index": 147,
      "start_seconds": 329,
      "source_timestamp": "5:29",
      "end_seconds": null,
      "text": "So this is clearly spec is too strong."
    },
    {
      "index": 148,
      "start_seconds": 333,
      "source_timestamp": "5:33",
      "end_seconds": null,
      "text": "So we thought about this, what do we"
    },
    {
      "index": 149,
      "start_seconds": 335,
      "source_timestamp": "5:35",
      "end_seconds": null,
      "text": "need to change to actually prove the"
    },
    {
      "index": 150,
      "start_seconds": 337,
      "source_timestamp": "5:37",
      "end_seconds": null,
      "text": "contract still correct?"
    },
    {
      "index": 151,
      "start_seconds": 340,
      "source_timestamp": "5:40",
      "end_seconds": null,
      "text": "And it turned out after thinking about"
    },
    {
      "index": 152,
      "start_seconds": 342,
      "source_timestamp": "5:42",
      "end_seconds": null,
      "text": "this,"
    },
    {
      "index": 153,
      "start_seconds": 343,
      "source_timestamp": "5:43",
      "end_seconds": null,
      "text": "the thing that you need to avoid is that"
    },
    {
      "index": 154,
      "start_seconds": 346,
      "source_timestamp": "5:46",
      "end_seconds": null,
      "text": "bad debt happened now at this point."
    },
    {
      "index": 155,
      "start_seconds": 349,
      "source_timestamp": "5:49",
      "end_seconds": null,
      "text": "And this led me to the question, what"
    },
    {
      "index": 156,
      "start_seconds": 351,
      "source_timestamp": "5:51",
      "end_seconds": null,
      "text": "happens if you liquidate at this point?"
    },
    {
      "index": 157,
      "start_seconds": 353,
      "source_timestamp": "5:53",
      "end_seconds": null,
      "text": "And I asked this on the channel, can you"
    },
    {
      "index": 158,
      "start_seconds": 356,
      "source_timestamp": "5:56",
      "end_seconds": null,
      "text": "liquidate yourself in the callback and"
    },
    {
      "index": 159,
      "start_seconds": 359,
      "source_timestamp": "5:59",
      "end_seconds": null,
      "text": "create debt bad debt for the protocol?"
    },
    {
      "index": 160,
      "start_seconds": 361,
      "source_timestamp": "6:01",
      "end_seconds": null,
      "text": "And afterwards, when the bad debt is"
    },
    {
      "index": 161,
      "start_seconds": 364,
      "source_timestamp": "6:04",
      "end_seconds": null,
      "text": "created,"
    },
    {
      "index": 162,
      "start_seconds": 365,
      "source_timestamp": "6:05",
      "end_seconds": null,
      "text": "you make yourself healthy again and then"
    },
    {
      "index": 163,
      "start_seconds": 367,
      "source_timestamp": "6:07",
      "end_seconds": null,
      "text": "everything is fine. The transaction"
    },
    {
      "index": 164,
      "start_seconds": 369,
      "source_timestamp": "6:09",
      "end_seconds": null,
      "text": "doesn't revert"
    },
    {
      "index": 165,
      "start_seconds": 371,
      "source_timestamp": "6:11",
      "end_seconds": null,
      "text": "and you have the money and"
    },
    {
      "index": 166,
      "start_seconds": 374,
      "source_timestamp": "6:14",
      "end_seconds": null,
      "text": "your bad debt was written off."
    },
    {
      "index": 167,
      "start_seconds": 379,
      "source_timestamp": "6:19",
      "end_seconds": null,
      "text": "And yeah, there was"
    },
    {
      "index": 168,
      "start_seconds": 381,
      "source_timestamp": "6:21",
      "end_seconds": null,
      "text": "15 minutes later I got the answer. Yes,"
    },
    {
      "index": 169,
      "start_seconds": 384,
      "source_timestamp": "6:24",
      "end_seconds": null,
      "text": "it's indeed a problem of the protocol."
    },
    {
      "index": 170,
      "start_seconds": 387,
      "source_timestamp": "6:27",
      "end_seconds": null,
      "text": "So yeah,"
    },
    {
      "index": 171,
      "start_seconds": 389,
      "source_timestamp": "6:29",
      "end_seconds": null,
      "text": "they liked this finding. They didn't"
    },
    {
      "index": 172,
      "start_seconds": 391,
      "source_timestamp": "6:31",
      "end_seconds": null,
      "text": "expect this. It's a critical bug. You"
    },
    {
      "index": 173,
      "start_seconds": 394,
      "source_timestamp": "6:34",
      "end_seconds": null,
      "text": "can basically make a loan for free."
    },
    {
      "index": 174,
      "start_seconds": 397,
      "source_timestamp": "6:37",
      "end_seconds": null,
      "text": "And it basically also put the whole fry"
    },
    {
      "index": 175,
      "start_seconds": 400,
      "source_timestamp": "6:40",
      "end_seconds": null,
      "text": "p pattern into question if this"
    },
    {
      "index": 176,
      "start_seconds": 405,
      "source_timestamp": "6:45",
      "end_seconds": null,
      "text": "yeah, you can't just use it. You have to"
    },
    {
      "index": 177,
      "start_seconds": 407,
      "source_timestamp": "6:47",
      "end_seconds": null,
      "text": "argue why it's safe and in this case it"
    },
    {
      "index": 178,
      "start_seconds": 409,
      "source_timestamp": "6:49",
      "end_seconds": null,
      "text": "wasn't safe."
    },
    {
      "index": 179,
      "start_seconds": 411,
      "source_timestamp": "6:51",
      "end_seconds": null,
      "text": "So the conclusion is this counter"
    },
    {
      "index": 180,
      "start_seconds": 412,
      "source_timestamp": "6:52",
      "end_seconds": null,
      "text": "example that we found is not spurious."
    },
    {
      "index": 181,
      "start_seconds": 416,
      "source_timestamp": "6:56",
      "end_seconds": null,
      "text": "So yeah, and we found this before the"
    },
    {
      "index": 182,
      "start_seconds": 418,
      "source_timestamp": "6:58",
      "end_seconds": null,
      "text": "first audit, seven weeks before the"
    },
    {
      "index": 183,
      "start_seconds": 420,
      "source_timestamp": "7:00",
      "end_seconds": null,
      "text": "first audit. So"
    },
    {
      "index": 184,
      "start_seconds": 422,
      "source_timestamp": "7:02",
      "end_seconds": null,
      "text": "it was time enough to fix this for the"
    },
    {
      "index": 185,
      "start_seconds": 424,
      "source_timestamp": "7:04",
      "end_seconds": null,
      "text": "audit."
    },
    {
      "index": 186,
      "start_seconds": 427,
      "source_timestamp": "7:07",
      "end_seconds": null,
      "text": "So what how does this attack look? So"
    },
    {
      "index": 187,
      "start_seconds": 429,
      "source_timestamp": "7:09",
      "end_seconds": null,
      "text": "you have a an evil borrower and he wants"
    },
    {
      "index": 188,
      "start_seconds": 432,
      "source_timestamp": "7:12",
      "end_seconds": null,
      "text": "to attack the protocol. So he takes a"
    },
    {
      "index": 189,
      "start_seconds": 435,
      "source_timestamp": "7:15",
      "end_seconds": null,
      "text": "loan. Let's say he just chooses one of"
    },
    {
      "index": 190,
      "start_seconds": 437,
      "source_timestamp": "7:17",
      "end_seconds": null,
      "text": "the offerings of $1 million."
    },
    {
      "index": 191,
      "start_seconds": 440,
      "source_timestamp": "7:20",
      "end_seconds": null,
      "text": "And then he yeah, takes the loan. The"
    },
    {
      "index": 192,
      "start_seconds": 443,
      "source_timestamp": "7:23",
      "end_seconds": null,
      "text": "protocol sends the money without the"
    },
    {
      "index": 193,
      "start_seconds": 445,
      "source_timestamp": "7:25",
      "end_seconds": null,
      "text": "interest."
    },
    {
      "index": 194,
      "start_seconds": 447,
      "source_timestamp": "7:27",
      "end_seconds": null,
      "text": "And"
    },
    {
      "index": 195,
      "start_seconds": 448,
      "source_timestamp": "7:28",
      "end_seconds": null,
      "text": "then the on sale callback is called"
    },
    {
      "index": 196,
      "start_seconds": 450,
      "source_timestamp": "7:30",
      "end_seconds": null,
      "text": "where the attacker should now"
    },
    {
      "index": 197,
      "start_seconds": 453,
      "source_timestamp": "7:33",
      "end_seconds": null,
      "text": "put in the collateral. But instead of"
    },
    {
      "index": 198,
      "start_seconds": 455,
      "source_timestamp": "7:35",
      "end_seconds": null,
      "text": "putting in the collateral,"
    },
    {
      "index": 199,
      "start_seconds": 457,
      "source_timestamp": "7:37",
      "end_seconds": null,
      "text": "the callback would just call the"
    },
    {
      "index": 200,
      "start_seconds": 459,
      "source_timestamp": "7:39",
      "end_seconds": null,
      "text": "liquidate function and liquidate"
    },
    {
      "index": 201,
      "start_seconds": 462,
      "source_timestamp": "7:42",
      "end_seconds": null,
      "text": "the"
    },
    {
      "index": 202,
      "start_seconds": 463,
      "source_timestamp": "7:43",
      "end_seconds": null,
      "text": "caller himself."
    },
    {
      "index": 203,
      "start_seconds": 465,
      "source_timestamp": "7:45",
      "end_seconds": null,
      "text": "And what happens now is that the bad"
    },
    {
      "index": 204,
      "start_seconds": 467,
      "source_timestamp": "7:47",
      "end_seconds": null,
      "text": "debt is written off and the"
    },
    {
      "index": 205,
      "start_seconds": 470,
      "source_timestamp": "7:50",
      "end_seconds": null,
      "text": "caller of liquidate needs to pay for the"
    },
    {
      "index": 206,
      "start_seconds": 472,
      "source_timestamp": "7:52",
      "end_seconds": null,
      "text": "collateral."
    },
    {
      "index": 207,
      "start_seconds": 473,
      "source_timestamp": "7:53",
      "end_seconds": null,
      "text": "But since there is no collateral, he"
    },
    {
      "index": 208,
      "start_seconds": 475,
      "source_timestamp": "7:55",
      "end_seconds": null,
      "text": "doesn't pay anything. He pays zero and"
    },
    {
      "index": 209,
      "start_seconds": 479,
      "source_timestamp": "7:59",
      "end_seconds": null,
      "text": "the full bad debt is written off."
    },
    {
      "index": 210,
      "start_seconds": 483,
      "source_timestamp": "8:03",
      "end_seconds": null,
      "text": "The callback succeeds."
    },
    {
      "index": 211,
      "start_seconds": 485,
      "source_timestamp": "8:05",
      "end_seconds": null,
      "text": "Now the user's healthy. He doesn't have"
    },
    {
      "index": 212,
      "start_seconds": 487,
      "source_timestamp": "8:07",
      "end_seconds": null,
      "text": "any debt anymore, the attacker."
    },
    {
      "index": 213,
      "start_seconds": 490,
      "source_timestamp": "8:10",
      "end_seconds": null,
      "text": "So he's healthy, the transaction"
    },
    {
      "index": 214,
      "start_seconds": 492,
      "source_timestamp": "8:12",
      "end_seconds": null,
      "text": "succeeds."
    },
    {
      "index": 215,
      "start_seconds": 493,
      "source_timestamp": "8:13",
      "end_seconds": null,
      "text": "And what happens is 960k USDC is sent to"
    },
    {
      "index": 216,
      "start_seconds": 498,
      "source_timestamp": "8:18",
      "end_seconds": null,
      "text": "the attacker. He didn't put any"
    },
    {
      "index": 217,
      "start_seconds": 499,
      "source_timestamp": "8:19",
      "end_seconds": null,
      "text": "collateral"
    },
    {
      "index": 218,
      "start_seconds": 501,
      "source_timestamp": "8:21",
      "end_seconds": null,
      "text": "and uh the debt is already written off"
    },
    {
      "index": 219,
      "start_seconds": 504,
      "source_timestamp": "8:24",
      "end_seconds": null,
      "text": "and the people that are hurt are the"
    },
    {
      "index": 220,
      "start_seconds": 506,
      "source_timestamp": "8:26",
      "end_seconds": null,
      "text": "other lenders who now get less money out"
    },
    {
      "index": 221,
      "start_seconds": 509,
      "source_timestamp": "8:29",
      "end_seconds": null,
      "text": "of the contract."
    },
    {
      "index": 222,
      "start_seconds": 513,
      "source_timestamp": "8:33",
      "end_seconds": null,
      "text": "So"
    },
    {
      "index": 223,
      "start_seconds": 515,
      "source_timestamp": "8:35",
      "end_seconds": null,
      "text": "we thought about this, how can we close"
    },
    {
      "index": 224,
      "start_seconds": 517,
      "source_timestamp": "8:37",
      "end_seconds": null,
      "text": "this protocol? Uh how can we close this"
    },
    {
      "index": 225,
      "start_seconds": 520,
      "source_timestamp": "8:40",
      "end_seconds": null,
      "text": "callback window? And there were three"
    },
    {
      "index": 226,
      "start_seconds": 523,
      "source_timestamp": "8:43",
      "end_seconds": null,
      "text": "possible solution."
    },
    {
      "index": 227,
      "start_seconds": 525,
      "source_timestamp": "8:45",
      "end_seconds": null,
      "text": "One is you book the debt after the"
    },
    {
      "index": 228,
      "start_seconds": 527,
      "source_timestamp": "8:47",
      "end_seconds": null,
      "text": "callback."
    },
    {
      "index": 229,
      "start_seconds": 528,
      "source_timestamp": "8:48",
      "end_seconds": null,
      "text": "This is a kind of a trick um by"
    },
    {
      "index": 230,
      "start_seconds": 532,
      "source_timestamp": "8:52",
      "end_seconds": null,
      "text": "not updating the debt before the"
    },
    {
      "index": 231,
      "start_seconds": 534,
      "source_timestamp": "8:54",
      "end_seconds": null,
      "text": "callback, you don't have debt during the"
    },
    {
      "index": 232,
      "start_seconds": 536,
      "source_timestamp": "8:56",
      "end_seconds": null,
      "text": "callback, so you are healthy."
    },
    {
      "index": 233,
      "start_seconds": 539,
      "source_timestamp": "8:59",
      "end_seconds": null,
      "text": "And uh this would in principle work,"
    },
    {
      "index": 234,
      "start_seconds": 543,
      "source_timestamp": "9:03",
      "end_seconds": null,
      "text": "but it has some problems because yeah it"
    },
    {
      "index": 235,
      "start_seconds": 547,
      "source_timestamp": "9:07",
      "end_seconds": null,
      "text": "it doesn't match the pattern. You want"
    },
    {
      "index": 236,
      "start_seconds": 548,
      "source_timestamp": "9:08",
      "end_seconds": null,
      "text": "to do all the modification before the"
    },
    {
      "index": 237,
      "start_seconds": 551,
      "source_timestamp": "9:11",
      "end_seconds": null,
      "text": "callback."
    },
    {
      "index": 238,
      "start_seconds": 552,
      "source_timestamp": "9:12",
      "end_seconds": null,
      "text": "And also it's the talk to means time of"
    },
    {
      "index": 239,
      "start_seconds": 556,
      "source_timestamp": "9:16",
      "end_seconds": null,
      "text": "check versus time of use. If you do all"
    },
    {
      "index": 240,
      "start_seconds": 559,
      "source_timestamp": "9:19",
      "end_seconds": null,
      "text": "the checks before the callback, then you"
    },
    {
      "index": 241,
      "start_seconds": 561,
      "source_timestamp": "9:21",
      "end_seconds": null,
      "text": "do the callback, then the callback may"
    },
    {
      "index": 242,
      "start_seconds": 563,
      "source_timestamp": "9:23",
      "end_seconds": null,
      "text": "invalidate all your checks. So you have"
    },
    {
      "index": 243,
      "start_seconds": 566,
      "source_timestamp": "9:26",
      "end_seconds": null,
      "text": "to do the checks again and it was kind"
    },
    {
      "index": 244,
      "start_seconds": 568,
      "source_timestamp": "9:28",
      "end_seconds": null,
      "text": "of messy. So"
    },
    {
      "index": 245,
      "start_seconds": 570,
      "source_timestamp": "9:30",
      "end_seconds": null,
      "text": "um we implemented this but decided in"
    },
    {
      "index": 246,
      "start_seconds": 573,
      "source_timestamp": "9:33",
      "end_seconds": null,
      "text": "the end to not go this way."
    },
    {
      "index": 247,
      "start_seconds": 575,
      "source_timestamp": "9:35",
      "end_seconds": null,
      "text": "Instead what we did is use liquidation"
    },
    {
      "index": 248,
      "start_seconds": 578,
      "source_timestamp": "9:38",
      "end_seconds": null,
      "text": "locks."
    },
    {
      "index": 249,
      "start_seconds": 580,
      "source_timestamp": "9:40",
      "end_seconds": null,
      "text": "And there was a possibility of doing it"
    },
    {
      "index": 250,
      "start_seconds": 582,
      "source_timestamp": "9:42",
      "end_seconds": null,
      "text": "globally or per position and in the end"
    },
    {
      "index": 251,
      "start_seconds": 584,
      "source_timestamp": "9:44",
      "end_seconds": null,
      "text": "we decided to do it per position because"
    },
    {
      "index": 252,
      "start_seconds": 587,
      "source_timestamp": "9:47",
      "end_seconds": null,
      "text": "it's uh least restrictive."
    },
    {
      "index": 253,
      "start_seconds": 590,
      "source_timestamp": "9:50",
      "end_seconds": null,
      "text": "And what we how this looks is in the"
    },
    {
      "index": 254,
      "start_seconds": 593,
      "source_timestamp": "9:53",
      "end_seconds": null,
      "text": "take function"
    },
    {
      "index": 255,
      "start_seconds": 594,
      "source_timestamp": "9:54",
      "end_seconds": null,
      "text": "you surround this interaction phase"
    },
    {
      "index": 256,
      "start_seconds": 597,
      "source_timestamp": "9:57",
      "end_seconds": null,
      "text": "by putting a lock on the position."
    },
    {
      "index": 257,
      "start_seconds": 602,
      "source_timestamp": "10:02",
      "end_seconds": null,
      "text": "And after the wards you unlock again"
    },
    {
      "index": 258,
      "start_seconds": 606,
      "source_timestamp": "10:06",
      "end_seconds": null,
      "text": "unless it wasn't locked before, so you"
    },
    {
      "index": 259,
      "start_seconds": 608,
      "source_timestamp": "10:08",
      "end_seconds": null,
      "text": "keep the lock as it is and the uh"
    },
    {
      "index": 260,
      "start_seconds": 612,
      "source_timestamp": "10:12",
      "end_seconds": null,
      "text": "the protocol invariant also changes"
    },
    {
      "index": 261,
      "start_seconds": 614,
      "source_timestamp": "10:14",
      "end_seconds": null,
      "text": "because now if you are locked, you don't"
    },
    {
      "index": 262,
      "start_seconds": 617,
      "source_timestamp": "10:17",
      "end_seconds": null,
      "text": "need to be healthy because you can't be"
    },
    {
      "index": 263,
      "start_seconds": 619,
      "source_timestamp": "10:19",
      "end_seconds": null,
      "text": "liquidated."
    },
    {
      "index": 264,
      "start_seconds": 622,
      "source_timestamp": "10:22",
      "end_seconds": null,
      "text": "And the lock is in transient storage, so"
    },
    {
      "index": 265,
      "start_seconds": 625,
      "source_timestamp": "10:25",
      "end_seconds": null,
      "text": "it's only visible during the"
    },
    {
      "index": 266,
      "start_seconds": 627,
      "source_timestamp": "10:27",
      "end_seconds": null,
      "text": "transaction."
    },
    {
      "index": 267,
      "start_seconds": 628,
      "source_timestamp": "10:28",
      "end_seconds": null,
      "text": "And the other change which is not on the"
    },
    {
      "index": 268,
      "start_seconds": 630,
      "source_timestamp": "10:30",
      "end_seconds": null,
      "text": "slide is the liquidate function. You"
    },
    {
      "index": 269,
      "start_seconds": 632,
      "source_timestamp": "10:32",
      "end_seconds": null,
      "text": "check that the position is not locked"
    },
    {
      "index": 270,
      "start_seconds": 634,
      "source_timestamp": "10:34",
      "end_seconds": null,
      "text": "and if it's locked you revert. So if you"
    },
    {
      "index": 271,
      "start_seconds": 636,
      "source_timestamp": "10:36",
      "end_seconds": null,
      "text": "play back the same attack here,"
    },
    {
      "index": 272,
      "start_seconds": 639,
      "source_timestamp": "10:39",
      "end_seconds": null,
      "text": "the liquidate function would just say"
    },
    {
      "index": 273,
      "start_seconds": 640,
      "source_timestamp": "10:40",
      "end_seconds": null,
      "text": "it's not liquidatable revert and then"
    },
    {
      "index": 274,
      "start_seconds": 643,
      "source_timestamp": "10:43",
      "end_seconds": null,
      "text": "the whole transaction reverts."
    },
    {
      "index": 275,
      "start_seconds": 647,
      "source_timestamp": "10:47",
      "end_seconds": null,
      "text": "So you can't write off bad debt."
    },
    {
      "index": 276,
      "start_seconds": 650,
      "source_timestamp": "10:50",
      "end_seconds": null,
      "text": "So"
    },
    {
      "index": 277,
      "start_seconds": 652,
      "source_timestamp": "10:52",
      "end_seconds": null,
      "text": "yeah, the next question is can we now"
    },
    {
      "index": 278,
      "start_seconds": 654,
      "source_timestamp": "10:54",
      "end_seconds": null,
      "text": "prove that the protocol doesn't have"
    },
    {
      "index": 279,
      "start_seconds": 657,
      "source_timestamp": "10:57",
      "end_seconds": null,
      "text": "this problem anymore?"
    },
    {
      "index": 280,
      "start_seconds": 660,
      "source_timestamp": "11:00",
      "end_seconds": null,
      "text": "And so we reproved the property and"
    },
    {
      "index": 281,
      "start_seconds": 662,
      "source_timestamp": "11:02",
      "end_seconds": null,
      "text": "instead of having the invariant, the"
    },
    {
      "index": 282,
      "start_seconds": 664,
      "source_timestamp": "11:04",
      "end_seconds": null,
      "text": "strong invariant is healthy, we now have"
    },
    {
      "index": 283,
      "start_seconds": 667,
      "source_timestamp": "11:07",
      "end_seconds": null,
      "text": "a weaker invariant. It's either"
    },
    {
      "index": 284,
      "start_seconds": 670,
      "source_timestamp": "11:10",
      "end_seconds": null,
      "text": "healthy or locked."
    },
    {
      "index": 285,
      "start_seconds": 672,
      "source_timestamp": "11:12",
      "end_seconds": null,
      "text": "And this invariant also holds during the"
    },
    {
      "index": 286,
      "start_seconds": 674,
      "source_timestamp": "11:14",
      "end_seconds": null,
      "text": "callbacks."
    },
    {
      "index": 287,
      "start_seconds": 676,
      "source_timestamp": "11:16",
      "end_seconds": null,
      "text": "And this strong invariant is"
    },
    {
      "index": 288,
      "start_seconds": 679,
      "source_timestamp": "11:19",
      "end_seconds": null,
      "text": "weaker than is healthy, but it's strong"
    },
    {
      "index": 289,
      "start_seconds": 681,
      "source_timestamp": "11:21",
      "end_seconds": null,
      "text": "enough to prove that there is no bad"
    },
    {
      "index": 290,
      "start_seconds": 683,
      "source_timestamp": "11:23",
      "end_seconds": null,
      "text": "debt because there are two cases"
    },
    {
      "index": 291,
      "start_seconds": 686,
      "source_timestamp": "11:26",
      "end_seconds": null,
      "text": "basically if the position is healthy,"
    },
    {
      "index": 292,
      "start_seconds": 688,
      "source_timestamp": "11:28",
      "end_seconds": null,
      "text": "there is no bad debt because of over"
    },
    {
      "index": 293,
      "start_seconds": 690,
      "source_timestamp": "11:30",
      "end_seconds": null,
      "text": "collateralization."
    },
    {
      "index": 294,
      "start_seconds": 692,
      "source_timestamp": "11:32",
      "end_seconds": null,
      "text": "And if the position is locked,"
    },
    {
      "index": 295,
      "start_seconds": 694,
      "source_timestamp": "11:34",
      "end_seconds": null,
      "text": "then the liquidate function reverts"
    },
    {
      "index": 296,
      "start_seconds": 696,
      "source_timestamp": "11:36",
      "end_seconds": null,
      "text": "immediately, so it cannot"
    },
    {
      "index": 297,
      "start_seconds": 699,
      "source_timestamp": "11:39",
      "end_seconds": null,
      "text": "put any bad debt in there."
    },
    {
      "index": 298,
      "start_seconds": 702,
      "source_timestamp": "11:42",
      "end_seconds": null,
      "text": "And we prove both properties formally"
    },
    {
      "index": 299,
      "start_seconds": 705,
      "source_timestamp": "11:45",
      "end_seconds": null,
      "text": "with our prover."
    },
    {
      "index": 300,
      "start_seconds": 706,
      "source_timestamp": "11:46",
      "end_seconds": null,
      "text": "And now we know that there is no bad"
    },
    {
      "index": 301,
      "start_seconds": 708,
      "source_timestamp": "11:48",
      "end_seconds": null,
      "text": "debt."
    },
    {
      "index": 302,
      "start_seconds": 710,
      "source_timestamp": "11:50",
      "end_seconds": null,
      "text": "Of course, there could be another"
    },
    {
      "index": 303,
      "start_seconds": 712,
      "source_timestamp": "11:52",
      "end_seconds": null,
      "text": "problem here, namely"
    },
    {
      "index": 304,
      "start_seconds": 715,
      "source_timestamp": "11:55",
      "end_seconds": null,
      "text": "the locking could prevent liquidations"
    },
    {
      "index": 305,
      "start_seconds": 718,
      "source_timestamp": "11:58",
      "end_seconds": null,
      "text": "that that are necessary. So you"
    },
    {
      "index": 306,
      "start_seconds": 720,
      "source_timestamp": "12:00",
      "end_seconds": null,
      "text": "want also to show"
    },
    {
      "index": 307,
      "start_seconds": 722,
      "source_timestamp": "12:02",
      "end_seconds": null,
      "text": "that the lock is"
    },
    {
      "index": 308,
      "start_seconds": 725,
      "source_timestamp": "12:05",
      "end_seconds": null,
      "text": "never leaking out of the transaction."
    },
    {
      "index": 309,
      "start_seconds": 729,
      "source_timestamp": "12:09",
      "end_seconds": null,
      "text": "And so for this we proved a weak"
    },
    {
      "index": 310,
      "start_seconds": 730,
      "source_timestamp": "12:10",
      "end_seconds": null,
      "text": "invariant and the weak invariant only"
    },
    {
      "index": 311,
      "start_seconds": 732,
      "source_timestamp": "12:12",
      "end_seconds": null,
      "text": "holds at the beginning and the end. It's"
    },
    {
      "index": 312,
      "start_seconds": 735,
      "source_timestamp": "12:15",
      "end_seconds": null,
      "text": "basically without the strong keyword,"
    },
    {
      "index": 313,
      "start_seconds": 737,
      "source_timestamp": "12:17",
      "end_seconds": null,
      "text": "but we also have the weak keyword to"
    },
    {
      "index": 314,
      "start_seconds": 739,
      "source_timestamp": "12:19",
      "end_seconds": null,
      "text": "clarify this."
    },
    {
      "index": 315,
      "start_seconds": 741,
      "source_timestamp": "12:21",
      "end_seconds": null,
      "text": "And so outside the transaction we now"
    },
    {
      "index": 316,
      "start_seconds": 743,
      "source_timestamp": "12:23",
      "end_seconds": null,
      "text": "have the invariant not locked."
    },
    {
      "index": 317,
      "start_seconds": 745,
      "source_timestamp": "12:25",
      "end_seconds": null,
      "text": "And with this weak invariant we can"
    },
    {
      "index": 318,
      "start_seconds": 748,
      "source_timestamp": "12:28",
      "end_seconds": null,
      "text": "actually also prove that the user is"
    },
    {
      "index": 319,
      "start_seconds": 750,
      "source_timestamp": "12:30",
      "end_seconds": null,
      "text": "healthy after every transaction."
    },
    {
      "index": 320,
      "start_seconds": 755,
      "source_timestamp": "12:35",
      "end_seconds": null,
      "text": "And to prove this weak invariant we"
    },
    {
      "index": 321,
      "start_seconds": 757,
      "source_timestamp": "12:37",
      "end_seconds": null,
      "text": "needed another property"
    },
    {
      "index": 322,
      "start_seconds": 760,
      "source_timestamp": "12:40",
      "end_seconds": null,
      "text": "to formally prove it. And this was that"
    },
    {
      "index": 323,
      "start_seconds": 764,
      "source_timestamp": "12:44",
      "end_seconds": null,
      "text": "the lock status never changes during a"
    },
    {
      "index": 324,
      "start_seconds": 766,
      "source_timestamp": "12:46",
      "end_seconds": null,
      "text": "transaction."
    },
    {
      "index": 325,
      "start_seconds": 767,
      "source_timestamp": "12:47",
      "end_seconds": null,
      "text": "So for this we wrote another rule"
    },
    {
      "index": 326,
      "start_seconds": 771,
      "source_timestamp": "12:51",
      "end_seconds": null,
      "text": "which proves that if you take the lock"
    },
    {
      "index": 327,
      "start_seconds": 773,
      "source_timestamp": "12:53",
      "end_seconds": null,
      "text": "status before it"
    },
    {
      "index": 328,
      "start_seconds": 775,
      "source_timestamp": "12:55",
      "end_seconds": null,
      "text": "any operation then you do any operation"
    },
    {
      "index": 329,
      "start_seconds": 777,
      "source_timestamp": "12:57",
      "end_seconds": null,
      "text": "of the contract"
    },
    {
      "index": 330,
      "start_seconds": 779,
      "source_timestamp": "12:59",
      "end_seconds": null,
      "text": "the lock status stays the same."
    },
    {
      "index": 331,
      "start_seconds": 781,
      "source_timestamp": "13:01",
      "end_seconds": null,
      "text": "And using this rule you can assume"
    },
    {
      "index": 332,
      "start_seconds": 785,
      "source_timestamp": "13:05",
      "end_seconds": null,
      "text": "that the callbacks the callback summary"
    },
    {
      "index": 333,
      "start_seconds": 788,
      "source_timestamp": "13:08",
      "end_seconds": null,
      "text": "where we havoc"
    },
    {
      "index": 334,
      "start_seconds": 789,
      "source_timestamp": "13:09",
      "end_seconds": null,
      "text": "will also ensure this property that the"
    },
    {
      "index": 335,
      "start_seconds": 791,
      "source_timestamp": "13:11",
      "end_seconds": null,
      "text": "lock status never changes."
    },
    {
      "index": 336,
      "start_seconds": 793,
      "source_timestamp": "13:13",
      "end_seconds": null,
      "text": "And then you can argue by induction"
    },
    {
      "index": 337,
      "start_seconds": 796,
      "source_timestamp": "13:16",
      "end_seconds": null,
      "text": "that this is now"
    },
    {
      "index": 338,
      "start_seconds": 798,
      "source_timestamp": "13:18",
      "end_seconds": null,
      "text": "a sound reasoning that the contract is"
    },
    {
      "index": 339,
      "start_seconds": 800,
      "source_timestamp": "13:20",
      "end_seconds": null,
      "text": "locked after the transaction."
    },
    {
      "index": 340,
      "start_seconds": 805,
      "source_timestamp": "13:25",
      "end_seconds": null,
      "text": "So"
    },
    {
      "index": 341,
      "start_seconds": 806,
      "source_timestamp": "13:26",
      "end_seconds": null,
      "text": "this is one of the property that we"
    },
    {
      "index": 342,
      "start_seconds": 808,
      "source_timestamp": "13:28",
      "end_seconds": null,
      "text": "showed this is healthiness, but we"
    },
    {
      "index": 343,
      "start_seconds": 811,
      "source_timestamp": "13:31",
      "end_seconds": null,
      "text": "actually proved many more properties in"
    },
    {
      "index": 344,
      "start_seconds": 813,
      "source_timestamp": "13:33",
      "end_seconds": null,
      "text": "the end. So another important property"
    },
    {
      "index": 345,
      "start_seconds": 816,
      "source_timestamp": "13:36",
      "end_seconds": null,
      "text": "is solvency."
    },
    {
      "index": 346,
      "start_seconds": 818,
      "source_timestamp": "13:38",
      "end_seconds": null,
      "text": "This consists of two parts. First, there"
    },
    {
      "index": 347,
      "start_seconds": 820,
      "source_timestamp": "13:40",
      "end_seconds": null,
      "text": "are enough tokens in the contract to"
    },
    {
      "index": 348,
      "start_seconds": 823,
      "source_timestamp": "13:43",
      "end_seconds": null,
      "text": "cover all the collateral and other"
    },
    {
      "index": 349,
      "start_seconds": 826,
      "source_timestamp": "13:46",
      "end_seconds": null,
      "text": "obligations, the fees and"
    },
    {
      "index": 350,
      "start_seconds": 828,
      "source_timestamp": "13:48",
      "end_seconds": null,
      "text": "the already"
    },
    {
      "index": 351,
      "start_seconds": 830,
      "source_timestamp": "13:50",
      "end_seconds": null,
      "text": "repaid loans."
    },
    {
      "index": 352,
      "start_seconds": 832,
      "source_timestamp": "13:52",
      "end_seconds": null,
      "text": "And then you have the other solvency"
    },
    {
      "index": 353,
      "start_seconds": 834,
      "source_timestamp": "13:54",
      "end_seconds": null,
      "text": "which basically says that the debt"
    },
    {
      "index": 354,
      "start_seconds": 837,
      "source_timestamp": "13:57",
      "end_seconds": null,
      "text": "should cover the credits. So if you are"
    },
    {
      "index": 355,
      "start_seconds": 840,
      "source_timestamp": "14:00",
      "end_seconds": null,
      "text": "borrowing money there should be another"
    },
    {
      "index": 356,
      "start_seconds": 842,
      "source_timestamp": "14:02",
      "end_seconds": null,
      "text": "person owing you money."
    },
    {
      "index": 357,
      "start_seconds": 844,
      "source_timestamp": "14:04",
      "end_seconds": null,
      "text": "So the debt plus was was already paid"
    },
    {
      "index": 358,
      "start_seconds": 847,
      "source_timestamp": "14:07",
      "end_seconds": null,
      "text": "back, the withdrawable should be greater"
    },
    {
      "index": 359,
      "start_seconds": 849,
      "source_timestamp": "14:09",
      "end_seconds": null,
      "text": "equal than the total credit."
    },
    {
      "index": 360,
      "start_seconds": 852,
      "source_timestamp": "14:12",
      "end_seconds": null,
      "text": "And"
    },
    {
      "index": 361,
      "start_seconds": 853,
      "source_timestamp": "14:13",
      "end_seconds": null,
      "text": "these are the important solvency"
    },
    {
      "index": 362,
      "start_seconds": 855,
      "source_timestamp": "14:15",
      "end_seconds": null,
      "text": "invariants we proved. Another invariant"
    },
    {
      "index": 363,
      "start_seconds": 857,
      "source_timestamp": "14:17",
      "end_seconds": null,
      "text": "we proved is isolation. So if you have"
    },
    {
      "index": 364,
      "start_seconds": 860,
      "source_timestamp": "14:20",
      "end_seconds": null,
      "text": "multiple markets, then and one market"
    },
    {
      "index": 365,
      "start_seconds": 863,
      "source_timestamp": "14:23",
      "end_seconds": null,
      "text": "suffers losses, then it doesn't affect"
    },
    {
      "index": 366,
      "start_seconds": 865,
      "source_timestamp": "14:25",
      "end_seconds": null,
      "text": "any other market. And this is basically"
    },
    {
      "index": 367,
      "start_seconds": 868,
      "source_timestamp": "14:28",
      "end_seconds": null,
      "text": "shown by locality."
    },
    {
      "index": 368,
      "start_seconds": 871,
      "source_timestamp": "14:31",
      "end_seconds": null,
      "text": "And then we have liquidation properties"
    },
    {
      "index": 369,
      "start_seconds": 874,
      "source_timestamp": "14:34",
      "end_seconds": null,
      "text": "that you can always liquidate positions"
    },
    {
      "index": 370,
      "start_seconds": 877,
      "source_timestamp": "14:37",
      "end_seconds": null,
      "text": "which also uses the fact that you are"
    },
    {
      "index": 371,
      "start_seconds": 881,
      "source_timestamp": "14:41",
      "end_seconds": null,
      "text": "not locked outside the transaction. So"
    },
    {
      "index": 372,
      "start_seconds": 883,
      "source_timestamp": "14:43",
      "end_seconds": null,
      "text": "it's always possible to liquidate an"
    },
    {
      "index": 373,
      "start_seconds": 885,
      "source_timestamp": "14:45",
      "end_seconds": null,
      "text": "unhealthy"
    },
    {
      "index": 374,
      "start_seconds": 887,
      "source_timestamp": "14:47",
      "end_seconds": null,
      "text": "transaction. So all in all, Morpho"
    },
    {
      "index": 375,
      "start_seconds": 891,
      "source_timestamp": "14:51",
      "end_seconds": null,
      "text": "together with us"
    },
    {
      "index": 376,
      "start_seconds": 893,
      "source_timestamp": "14:53",
      "end_seconds": null,
      "text": "worked on the spec and it's over 50 spec"
    },
    {
      "index": 377,
      "start_seconds": 896,
      "source_timestamp": "14:56",
      "end_seconds": null,
      "text": "files, over 300 rules."
    },
    {
      "index": 378,
      "start_seconds": 900,
      "source_timestamp": "15:00",
      "end_seconds": null,
      "text": "So"
    },
    {
      "index": 379,
      "start_seconds": 902,
      "source_timestamp": "15:02",
      "end_seconds": null,
      "text": "and we also looked into other protocols"
    },
    {
      "index": 380,
      "start_seconds": 905,
      "source_timestamp": "15:05",
      "end_seconds": null,
      "text": "when we found this bug to figure out if"
    },
    {
      "index": 381,
      "start_seconds": 907,
      "source_timestamp": "15:07",
      "end_seconds": null,
      "text": "they have this similar problems."
    },
    {
      "index": 382,
      "start_seconds": 909,
      "source_timestamp": "15:09",
      "end_seconds": null,
      "text": "And it turns out"
    },
    {
      "index": 383,
      "start_seconds": 911,
      "source_timestamp": "15:11",
      "end_seconds": null,
      "text": "they all don't have any problems,"
    },
    {
      "index": 384,
      "start_seconds": 914,
      "source_timestamp": "15:14",
      "end_seconds": null,
      "text": "but for different reasons."
    },
    {
      "index": 385,
      "start_seconds": 917,
      "source_timestamp": "15:17",
      "end_seconds": null,
      "text": "So Uniswap before is of course not a"
    },
    {
      "index": 386,
      "start_seconds": 920,
      "source_timestamp": "15:20",
      "end_seconds": null,
      "text": "lending protocol, but it also has this"
    },
    {
      "index": 387,
      "start_seconds": 922,
      "source_timestamp": "15:22",
      "end_seconds": null,
      "text": "feature that you can"
    },
    {
      "index": 388,
      "start_seconds": 925,
      "source_timestamp": "15:25",
      "end_seconds": null,
      "text": "basically swap before putting in the"
    },
    {
      "index": 389,
      "start_seconds": 928,
      "source_timestamp": "15:28",
      "end_seconds": null,
      "text": "tokens. And you want to be sure that"
    },
    {
      "index": 390,
      "start_seconds": 930,
      "source_timestamp": "15:30",
      "end_seconds": null,
      "text": "it's good at the end."
    },
    {
      "index": 391,
      "start_seconds": 932,
      "source_timestamp": "15:32",
      "end_seconds": null,
      "text": "And their invariant"
    },
    {
      "index": 392,
      "start_seconds": 935,
      "source_timestamp": "15:35",
      "end_seconds": null,
      "text": "they have a protocol invariant basically"
    },
    {
      "index": 393,
      "start_seconds": 938,
      "source_timestamp": "15:38",
      "end_seconds": null,
      "text": "that"
    },
    {
      "index": 394,
      "start_seconds": 940,
      "source_timestamp": "15:40",
      "end_seconds": null,
      "text": "there should be no debt outside of"
    },
    {
      "index": 395,
      "start_seconds": 942,
      "source_timestamp": "15:42",
      "end_seconds": null,
      "text": "transaction. So the only broken"
    },
    {
      "index": 396,
      "start_seconds": 944,
      "source_timestamp": "15:44",
      "end_seconds": null,
      "text": "invariant during the callback is that"
    },
    {
      "index": 397,
      "start_seconds": 947,
      "source_timestamp": "15:47",
      "end_seconds": null,
      "text": "there is a temporary debt."
    },
    {
      "index": 398,
      "start_seconds": 949,
      "source_timestamp": "15:49",
      "end_seconds": null,
      "text": "And so it's like a flash loan and"
    },
    {
      "index": 399,
      "start_seconds": 951,
      "source_timestamp": "15:51",
      "end_seconds": null,
      "text": "nothing can forgive the debt and it's"
    },
    {
      "index": 400,
      "start_seconds": 953,
      "source_timestamp": "15:53",
      "end_seconds": null,
      "text": "checked at the end similar to the take"
    },
    {
      "index": 401,
      "start_seconds": 955,
      "source_timestamp": "15:55",
      "end_seconds": null,
      "text": "function."
    },
    {
      "index": 402,
      "start_seconds": 956,
      "source_timestamp": "15:56",
      "end_seconds": null,
      "text": "And Morpho Blue"
    },
    {
      "index": 403,
      "start_seconds": 958,
      "source_timestamp": "15:58",
      "end_seconds": null,
      "text": "the same problem didn't happen because"
    },
    {
      "index": 404,
      "start_seconds": 960,
      "source_timestamp": "16:00",
      "end_seconds": null,
      "text": "they do it the other way around. You"
    },
    {
      "index": 405,
      "start_seconds": 962,
      "source_timestamp": "16:02",
      "end_seconds": null,
      "text": "first put in the collateral and then you"
    },
    {
      "index": 406,
      "start_seconds": 964,
      "source_timestamp": "16:04",
      "end_seconds": null,
      "text": "have a callback where you can make the"
    },
    {
      "index": 407,
      "start_seconds": 966,
      "source_timestamp": "16:06",
      "end_seconds": null,
      "text": "debt using the collateral."
    },
    {
      "index": 408,
      "start_seconds": 968,
      "source_timestamp": "16:08",
      "end_seconds": null,
      "text": "But the collateral is only put in after"
    },
    {
      "index": 409,
      "start_seconds": 971,
      "source_timestamp": "16:11",
      "end_seconds": null,
      "text": "the callback. So you don't"
    },
    {
      "index": 410,
      "start_seconds": 973,
      "source_timestamp": "16:13",
      "end_seconds": null,
      "text": "use you can still make the debt without"
    },
    {
      "index": 411,
      "start_seconds": 977,
      "source_timestamp": "16:17",
      "end_seconds": null,
      "text": "putting the collateral first."
    },
    {
      "index": 412,
      "start_seconds": 979,
      "source_timestamp": "16:19",
      "end_seconds": null,
      "text": "But it's like a flash loan."
    },
    {
      "index": 413,
      "start_seconds": 981,
      "source_timestamp": "16:21",
      "end_seconds": null,
      "text": "And Aave V3 also has the flash loan"
    },
    {
      "index": 414,
      "start_seconds": 983,
      "source_timestamp": "16:23",
      "end_seconds": null,
      "text": "feature, and they actually update the"
    },
    {
      "index": 415,
      "start_seconds": 986,
      "source_timestamp": "16:26",
      "end_seconds": null,
      "text": "debt"
    },
    {
      "index": 416,
      "start_seconds": 987,
      "source_timestamp": "16:27",
      "end_seconds": null,
      "text": "after the callback."
    },
    {
      "index": 417,
      "start_seconds": 989,
      "source_timestamp": "16:29",
      "end_seconds": null,
      "text": "So if you don't repay the flash loan,"
    },
    {
      "index": 418,
      "start_seconds": 991,
      "source_timestamp": "16:31",
      "end_seconds": null,
      "text": "they update the debt and it's similar to"
    },
    {
      "index": 419,
      "start_seconds": 993,
      "source_timestamp": "16:33",
      "end_seconds": null,
      "text": "the solution A."
    },
    {
      "index": 420,
      "start_seconds": 995,
      "source_timestamp": "16:35",
      "end_seconds": null,
      "text": "So for them this solution was the one"
    },
    {
      "index": 421,
      "start_seconds": 997,
      "source_timestamp": "16:37",
      "end_seconds": null,
      "text": "they chose."
    },
    {
      "index": 422,
      "start_seconds": 999,
      "source_timestamp": "16:39",
      "end_seconds": null,
      "text": "For Aave V4 I think they decided to not"
    },
    {
      "index": 423,
      "start_seconds": 1001,
      "source_timestamp": "16:41",
      "end_seconds": null,
      "text": "use any flash loans because they"
    },
    {
      "index": 424,
      "start_seconds": 1004,
      "source_timestamp": "16:44",
      "end_seconds": null,
      "text": "yeah were not happy with other protocols"
    },
    {
      "index": 425,
      "start_seconds": 1007,
      "source_timestamp": "16:47",
      "end_seconds": null,
      "text": "being exploited by their flash loans, so"
    },
    {
      "index": 426,
      "start_seconds": 1009,
      "source_timestamp": "16:49",
      "end_seconds": null,
      "text": "they just disabled this feature."
    },
    {
      "index": 427,
      "start_seconds": 1012,
      "source_timestamp": "16:52",
      "end_seconds": null,
      "text": "And for Euler V2 it's very similar to"
    },
    {
      "index": 428,
      "start_seconds": 1015,
      "source_timestamp": "16:55",
      "end_seconds": null,
      "text": "Morpho Midnight."
    },
    {
      "index": 429,
      "start_seconds": 1016,
      "source_timestamp": "16:56",
      "end_seconds": null,
      "text": "There is the broken invariant that the"
    },
    {
      "index": 430,
      "start_seconds": 1019,
      "source_timestamp": "16:59",
      "end_seconds": null,
      "text": "account is unhealthy during all the"
    },
    {
      "index": 431,
      "start_seconds": 1021,
      "source_timestamp": "17:01",
      "end_seconds": null,
      "text": "callbacks, but they also have a lock for"
    },
    {
      "index": 432,
      "start_seconds": 1023,
      "source_timestamp": "17:03",
      "end_seconds": null,
      "text": "the vault. So if the vault is currently"
    },
    {
      "index": 433,
      "start_seconds": 1026,
      "source_timestamp": "17:06",
      "end_seconds": null,
      "text": "in operation then you can't liquidate"
    },
    {
      "index": 434,
      "start_seconds": 1029,
      "source_timestamp": "17:09",
      "end_seconds": null,
      "text": "it."
    },
    {
      "index": 435,
      "start_seconds": 1031,
      "source_timestamp": "17:11",
      "end_seconds": null,
      "text": "So yeah all in all the callback window"
    },
    {
      "index": 436,
      "start_seconds": 1033,
      "source_timestamp": "17:13",
      "end_seconds": null,
      "text": "is safe if you care for"
    },
    {
      "index": 437,
      "start_seconds": 1037,
      "source_timestamp": "17:17",
      "end_seconds": null,
      "text": "this and if you make sure that the"
    },
    {
      "index": 438,
      "start_seconds": 1038,
      "source_timestamp": "17:18",
      "end_seconds": null,
      "text": "broken state is repaid at the end and if"
    },
    {
      "index": 439,
      "start_seconds": 1041,
      "source_timestamp": "17:21",
      "end_seconds": null,
      "text": "you don't allow any permanent losses."
    },
    {
      "index": 440,
      "start_seconds": 1044,
      "source_timestamp": "17:24",
      "end_seconds": null,
      "text": "And this was the problem here that"
    },
    {
      "index": 441,
      "start_seconds": 1047,
      "source_timestamp": "17:27",
      "end_seconds": null,
      "text": "writing off the debt is permanent."
    },
    {
      "index": 442,
      "start_seconds": 1050,
      "source_timestamp": "17:30",
      "end_seconds": null,
      "text": "So takeaways."
    },
    {
      "index": 443,
      "start_seconds": 1054,
      "source_timestamp": "17:34",
      "end_seconds": null,
      "text": "First this"
    },
    {
      "index": 444,
      "start_seconds": 1055,
      "source_timestamp": "17:35",
      "end_seconds": null,
      "text": "cannot be used as is. This is basically"
    },
    {
      "index": 445,
      "start_seconds": 1058,
      "source_timestamp": "17:38",
      "end_seconds": null,
      "text": "what was in the chat message. You have"
    },
    {
      "index": 446,
      "start_seconds": 1060,
      "source_timestamp": "17:40",
      "end_seconds": null,
      "text": "to think about your protocol invariant"
    },
    {
      "index": 447,
      "start_seconds": 1063,
      "source_timestamp": "17:43",
      "end_seconds": null,
      "text": "if they are just"
    },
    {
      "index": 448,
      "start_seconds": 1065,
      "source_timestamp": "17:45",
      "end_seconds": null,
      "text": "necessary at the end of your transaction"
    },
    {
      "index": 449,
      "start_seconds": 1068,
      "source_timestamp": "17:48",
      "end_seconds": null,
      "text": "or if other functions that you can call"
    },
    {
      "index": 450,
      "start_seconds": 1070,
      "source_timestamp": "17:50",
      "end_seconds": null,
      "text": "from the callback rely on these"
    },
    {
      "index": 451,
      "start_seconds": 1072,
      "source_timestamp": "17:52",
      "end_seconds": null,
      "text": "invariants. So in this case the problem"
    },
    {
      "index": 452,
      "start_seconds": 1074,
      "source_timestamp": "17:54",
      "end_seconds": null,
      "text": "was that the liquidate function relies"
    },
    {
      "index": 453,
      "start_seconds": 1077,
      "source_timestamp": "17:57",
      "end_seconds": null,
      "text": "on the healthiness property. If you're"
    },
    {
      "index": 454,
      "start_seconds": 1079,
      "source_timestamp": "17:59",
      "end_seconds": null,
      "text": "not healthy then"
    },
    {
      "index": 455,
      "start_seconds": 1080,
      "source_timestamp": "18:00",
      "end_seconds": null,
      "text": "bad debt is written off immediately and"
    },
    {
      "index": 456,
      "start_seconds": 1082,
      "source_timestamp": "18:02",
      "end_seconds": null,
      "text": "so you must prevent this reentrancy into"
    },
    {
      "index": 457,
      "start_seconds": 1085,
      "source_timestamp": "18:05",
      "end_seconds": null,
      "text": "the liquidate function."
    },
    {
      "index": 458,
      "start_seconds": 1087,
      "source_timestamp": "18:07",
      "end_seconds": null,
      "text": "And in this this case we did it by a"
    },
    {
      "index": 459,
      "start_seconds": 1089,
      "source_timestamp": "18:09",
      "end_seconds": null,
      "text": "lock."
    },
    {
      "index": 460,
      "start_seconds": 1092,
      "source_timestamp": "18:12",
      "end_seconds": null,
      "text": "Yeah in general you should always check"
    },
    {
      "index": 461,
      "start_seconds": 1094,
      "source_timestamp": "18:14",
      "end_seconds": null,
      "text": "invariants where control leaves. So"
    },
    {
      "index": 462,
      "start_seconds": 1098,
      "source_timestamp": "18:18",
      "end_seconds": null,
      "text": "yeah"
    },
    {
      "index": 463,
      "start_seconds": 1099,
      "source_timestamp": "18:19",
      "end_seconds": null,
      "text": "in this case we found problem because we"
    },
    {
      "index": 464,
      "start_seconds": 1102,
      "source_timestamp": "18:22",
      "end_seconds": null,
      "text": "checked the strong invariant is healthy"
    },
    {
      "index": 465,
      "start_seconds": 1104,
      "source_timestamp": "18:24",
      "end_seconds": null,
      "text": "and figured out it was broken and then"
    },
    {
      "index": 466,
      "start_seconds": 1107,
      "source_timestamp": "18:27",
      "end_seconds": null,
      "text": "we"
    },
    {
      "index": 467,
      "start_seconds": 1108,
      "source_timestamp": "18:28",
      "end_seconds": null,
      "text": "thought"
    },
    {
      "index": 468,
      "start_seconds": 1109,
      "source_timestamp": "18:29",
      "end_seconds": null,
      "text": "can we still prove that the protocol is"
    },
    {
      "index": 469,
      "start_seconds": 1112,
      "source_timestamp": "18:32",
      "end_seconds": null,
      "text": "correct and then we found out that there"
    },
    {
      "index": 470,
      "start_seconds": 1114,
      "source_timestamp": "18:34",
      "end_seconds": null,
      "text": "is a bug. So if we would just have"
    },
    {
      "index": 471,
      "start_seconds": 1116,
      "source_timestamp": "18:36",
      "end_seconds": null,
      "text": "stopped at the weak invariant, we"
    },
    {
      "index": 472,
      "start_seconds": 1118,
      "source_timestamp": "18:38",
      "end_seconds": null,
      "text": "wouldn't have found the bug. So it's"
    },
    {
      "index": 473,
      "start_seconds": 1119,
      "source_timestamp": "18:39",
      "end_seconds": null,
      "text": "important to use these strong invariants"
    },
    {
      "index": 474,
      "start_seconds": 1122,
      "source_timestamp": "18:42",
      "end_seconds": null,
      "text": "and check them every time you have an"
    },
    {
      "index": 475,
      "start_seconds": 1124,
      "source_timestamp": "18:44",
      "end_seconds": null,
      "text": "interaction."
    },
    {
      "index": 476,
      "start_seconds": 1126,
      "source_timestamp": "18:46",
      "end_seconds": null,
      "text": "And"
    },
    {
      "index": 477,
      "start_seconds": 1128,
      "source_timestamp": "18:48",
      "end_seconds": null,
      "text": "yeah, if you change the spec,"
    },
    {
      "index": 478,
      "start_seconds": 1130,
      "source_timestamp": "18:50",
      "end_seconds": null,
      "text": "you also need new proofs."
    },
    {
      "index": 479,
      "start_seconds": 1133,
      "source_timestamp": "18:53",
      "end_seconds": null,
      "text": "For example, if you"
    },
    {
      "index": 480,
      "start_seconds": 1137,
      "source_timestamp": "18:57",
      "end_seconds": null,
      "text": "yeah,"
    },
    {
      "index": 481,
      "start_seconds": 1138,
      "source_timestamp": "18:58",
      "end_seconds": null,
      "text": "to prove that liquidation does not"
    },
    {
      "index": 482,
      "start_seconds": 1140,
      "source_timestamp": "19:00",
      "end_seconds": null,
      "text": "revert, which is an important property"
    },
    {
      "index": 483,
      "start_seconds": 1142,
      "source_timestamp": "19:02",
      "end_seconds": null,
      "text": "of the protocol, you need to show that"
    },
    {
      "index": 484,
      "start_seconds": 1145,
      "source_timestamp": "19:05",
      "end_seconds": null,
      "text": "your position is not locked."
    },
    {
      "index": 485,
      "start_seconds": 1148,
      "source_timestamp": "19:08",
      "end_seconds": null,
      "text": "And to prove that your position is not"
    },
    {
      "index": 486,
      "start_seconds": 1150,
      "source_timestamp": "19:10",
      "end_seconds": null,
      "text": "locked, you need to prove these other"
    },
    {
      "index": 487,
      "start_seconds": 1152,
      "source_timestamp": "19:12",
      "end_seconds": null,
      "text": "rule that any function doesn't change"
    },
    {
      "index": 488,
      "start_seconds": 1156,
      "source_timestamp": "19:16",
      "end_seconds": null,
      "text": "the lock status."
    },
    {
      "index": 489,
      "start_seconds": 1158,
      "source_timestamp": "19:18",
      "end_seconds": null,
      "text": "And if you do all this, then you have an"
    },
    {
      "index": 490,
      "start_seconds": 1161,
      "source_timestamp": "19:21",
      "end_seconds": null,
      "text": "inductive proof, formal proof that your"
    },
    {
      "index": 491,
      "start_seconds": 1164,
      "source_timestamp": "19:24",
      "end_seconds": null,
      "text": "protocol is correct."
    },
    {
      "index": 492,
      "start_seconds": 1167,
      "source_timestamp": "19:27",
      "end_seconds": null,
      "text": "And never ignore a counter example"
    },
    {
      "index": 493,
      "start_seconds": 1170,
      "source_timestamp": "19:30",
      "end_seconds": null,
      "text": "because they seem to be the spec seems"
    },
    {
      "index": 494,
      "start_seconds": 1173,
      "source_timestamp": "19:33",
      "end_seconds": null,
      "text": "to be too strong."
    },
    {
      "index": 495,
      "start_seconds": 1175,
      "source_timestamp": "19:35",
      "end_seconds": null,
      "text": "Think about it, why is the protocol"
    },
    {
      "index": 496,
      "start_seconds": 1177,
      "source_timestamp": "19:37",
      "end_seconds": null,
      "text": "still correct?"
    },
    {
      "index": 497,
      "start_seconds": 1179,
      "source_timestamp": "19:39",
      "end_seconds": null,
      "text": "And if you think have any doubt, ask the"
    },
    {
      "index": 498,
      "start_seconds": 1182,
      "source_timestamp": "19:42",
      "end_seconds": null,
      "text": "developers. And yeah, we asked the"
    },
    {
      "index": 499,
      "start_seconds": 1184,
      "source_timestamp": "19:44",
      "end_seconds": null,
      "text": "developers, we"
    },
    {
      "index": 500,
      "start_seconds": 1187,
      "source_timestamp": "19:47",
      "end_seconds": null,
      "text": "figured out there is a bug and we could"
    },
    {
      "index": 501,
      "start_seconds": 1189,
      "source_timestamp": "19:49",
      "end_seconds": null,
      "text": "fix it before even before the first"
    },
    {
      "index": 502,
      "start_seconds": 1191,
      "source_timestamp": "19:51",
      "end_seconds": null,
      "text": "audit."
    },
    {
      "index": 503,
      "start_seconds": 1195,
      "source_timestamp": "19:55",
      "end_seconds": null,
      "text": "Yeah, I want to say"
    },
    {
      "index": 504,
      "start_seconds": 1197,
      "source_timestamp": "19:57",
      "end_seconds": null,
      "text": "thank you"
    },
    {
      "index": 505,
      "start_seconds": 1199,
      "source_timestamp": "19:59",
      "end_seconds": null,
      "text": "and want to say this is also a team"
    },
    {
      "index": 506,
      "start_seconds": 1201,
      "source_timestamp": "20:01",
      "end_seconds": null,
      "text": "effort. So"
    },
    {
      "index": 507,
      "start_seconds": 1203,
      "source_timestamp": "20:03",
      "end_seconds": null,
      "text": "I didn't do all the roots myself, so"
    },
    {
      "index": 508,
      "start_seconds": 1206,
      "source_timestamp": "20:06",
      "end_seconds": null,
      "text": "Morpho"
    },
    {
      "index": 509,
      "start_seconds": 1209,
      "source_timestamp": "20:09",
      "end_seconds": null,
      "text": "has several people working on formal"
    },
    {
      "index": 510,
      "start_seconds": 1211,
      "source_timestamp": "20:11",
      "end_seconds": null,
      "text": "verification. There's also Mati and"
    },
    {
      "index": 511,
      "start_seconds": 1214,
      "source_timestamp": "20:14",
      "end_seconds": null,
      "text": "Adrien who worked on fixing this bug in"
    },
    {
      "index": 512,
      "start_seconds": 1217,
      "source_timestamp": "20:17",
      "end_seconds": null,
      "text": "the Solidity part and"
    },
    {
      "index": 513,
      "start_seconds": 1220,
      "source_timestamp": "20:20",
      "end_seconds": null,
      "text": "Quentin Bagard and Anty"
    },
    {
      "index": 514,
      "start_seconds": 1223,
      "source_timestamp": "20:23",
      "end_seconds": null,
      "text": "wrote the"
    },
    {
      "index": 515,
      "start_seconds": 1225,
      "source_timestamp": "20:25",
      "end_seconds": null,
      "text": "part of the formal verification rules."
    },
    {
      "index": 516,
      "start_seconds": 1228,
      "source_timestamp": "20:28",
      "end_seconds": null,
      "text": "And from the Setora side, Lilyong was"
    },
    {
      "index": 517,
      "start_seconds": 1230,
      "source_timestamp": "20:30",
      "end_seconds": null,
      "text": "working on it."
    },
    {
      "index": 518,
      "start_seconds": 1232,
      "source_timestamp": "20:32",
      "end_seconds": null,
      "text": "So here is"
    },
    {
      "index": 519,
      "start_seconds": 1234,
      "source_timestamp": "20:34",
      "end_seconds": null,
      "text": "yeah, the link to the repository if you"
    },
    {
      "index": 520,
      "start_seconds": 1236,
      "source_timestamp": "20:36",
      "end_seconds": null,
      "text": "want to see the full formal"
    },
    {
      "index": 521,
      "start_seconds": 1238,
      "source_timestamp": "20:38",
      "end_seconds": null,
      "text": "verification."
    },
    {
      "index": 522,
      "start_seconds": 1240,
      "source_timestamp": "20:40",
      "end_seconds": null,
      "text": "Yeah, thank you for your attention."
    },
    {
      "index": 523,
      "start_seconds": 1243,
      "source_timestamp": "20:43",
      "end_seconds": null,
      "text": ">> [applause]"
    }
  ]
}
