<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: UK Used Car Notes</title>
    <description>The latest articles on DEV Community by UK Used Car Notes (@ukusedcarnotes).</description>
    <link>https://dev.to/ukusedcarnotes</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4221163%2F1a3d85c8-4c46-4237-a5e3-307014889fe9.png</url>
      <title>DEV Community: UK Used Car Notes</title>
      <link>https://dev.to/ukusedcarnotes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ukusedcarnotes"/>
    <language>en</language>
    <item>
      <title>How we ran a prize draw anyone can re-check, in 66 lines of Python</title>
      <dc:creator>UK Used Car Notes</dc:creator>
      <pubDate>Tue, 24 Nov 2026 08:03:00 +0000</pubDate>
      <link>https://dev.to/ukusedcarnotes/how-we-ran-a-prize-draw-anyone-can-re-check-in-66-lines-of-python-20h4</link>
      <guid>https://dev.to/ukusedcarnotes/how-we-ran-a-prize-draw-anyone-can-re-check-in-66-lines-of-python-20h4</guid>
      <description>&lt;p&gt;Most online giveaways end with a post that says "congratulations to our winners" and nothing else. You either trust the company or you don't.&lt;/p&gt;

&lt;p&gt;We ran a small free prize draw at CarCheckHQ: 10 vehicle history report credits for UK drivers. We wanted a result anyone could check without trusting us at all.&lt;/p&gt;

&lt;p&gt;Under the UK advertising code, a prize draw has to be run fairly and the promoter has to be able to show it. We decided "show it" should mean anyone with Python 3 could rerun the draw at home and get the same winners.&lt;/p&gt;

&lt;p&gt;The draw ran at 12:00 on Monday 23 November 2026. Here's how it works, the actual numbers, and the script.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with "we picked at random"
&lt;/h2&gt;

&lt;p&gt;If we pick the random number, we could pick it again until we liked the answer. If we pick it after seeing the entries, we could quietly add or drop an entry. So two things need to be fixed in public before anyone, including us, knows the result:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The exact list of entries.&lt;/li&gt;
&lt;li&gt;A random number that nobody controls and nobody can know in advance.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 1: lock the entry list with a fingerprint
&lt;/h2&gt;

&lt;p&gt;Every entry gets a random ID (a UUID). No names or emails go anywhere near the draw.&lt;/p&gt;

&lt;p&gt;Before the draw, the script sorts the IDs and hashes them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;ids&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"entry_id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DictReader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"entry_id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;list_hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"\n"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sorting matters. Without it, the same entries exported in a different order would give a different hash and a different result.&lt;/p&gt;

&lt;p&gt;On the morning of the draw, hours before the random round existed, we published the entry count, the ID list itself and its SHA-256. The script hashes the sorted IDs without the header line, so its fingerprint is a different string from running sha256sum on the file.&lt;/p&gt;

&lt;p&gt;We published both before the round. Add, remove or change one ID and both fingerprints change completely.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Entries in the draw: 6&lt;/li&gt;
&lt;li&gt;SHA-256 of &lt;a href="https://carcheckhq.com/giveaway/g1-entries.csv" rel="noopener noreferrer"&gt;g1-entries.csv&lt;/a&gt;: &lt;code&gt;180c0241d882f23dd5583144fa704e6930183cbd064b1b4a91892272aee24768&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The script's entry_list_sha256: &lt;code&gt;c07ad0e385d0b318fd8db1695ef62ceec2df26738fe302c39032ea22461a6bc5&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: borrow randomness from drand
&lt;/h2&gt;

&lt;p&gt;For the random number we used &lt;a href="https://drand.love" rel="noopener noreferrer"&gt;drand&lt;/a&gt;, a public randomness beacon run by the League of Entropy, a group of independent organisations. Its "quicknet" chain publishes a new value every 3 seconds, and each value is a threshold BLS signature that no single member can produce or predict.&lt;/p&gt;

&lt;p&gt;Because rounds are on a fixed clock, you can work out which round will exist at a given moment long before it happens. We named the round in the giveaway terms weeks in advance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="no"&gt;GENESIS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1692803367&lt;/span&gt;   &lt;span class="c1"&gt;# quicknet genesis time&lt;/span&gt;
&lt;span class="no"&gt;PERIOD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;             &lt;span class="c1"&gt;# seconds per round&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;round_at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ts&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;GENESIS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="no"&gt;PERIOD&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# first round at or after ts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;12:00:00 GMT on 23 November 2026 is Unix time 1795435200, which gives round 34210612. That round didn't exist until the draw time, and nobody could steer it.&lt;/p&gt;

&lt;p&gt;The script fetches the round itself and takes the SHA-256 of the signature as the random value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fetch_round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"https://api.drand.sh/v2/beacons/quicknet/rounds/{r}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;sig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"signature"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromhex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sig&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Random value for round 34210612: &lt;code&gt;6e845af45ca6030a5b19bfb320f01fb709d4141fa43fb151353b0f9e18281d0d&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can open the round in your browser at &lt;code&gt;api.drand.sh/v2/beacons/quicknet/rounds/34210612&lt;/code&gt;, and drand's own tools can verify the signature against the League of Entropy public key.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: a seeded, unbiased shuffle
&lt;/h2&gt;

&lt;p&gt;The seed mixes the drand value with the entry-list fingerprint, so the result depends on both:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;seed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{rnd}:{list_hash}"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then it's a plain Fisher-Yates shuffle. The one detail worth copying is how it picks a random index. Taking a big hash modulo n is very slightly biased towards small numbers. So the script uses rejection sampling: it throws away any 256-bit value above the largest multiple of n and tries again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;rand_below&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;256&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{seed}:{counter[0]}"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With 256-bit numbers the bias would have been tiny anyway, but "tiny" is a strange thing to have to explain to a winner who didn't win. Rejection sampling makes it exactly fair.&lt;/p&gt;

&lt;p&gt;The first 10 IDs in the shuffled list win. With more than 10 entries, the next 10 would be reserves, used in order if a prize isn't claimed. There's no re-draw.&lt;/p&gt;

&lt;p&gt;There were 6 entries in the draw, fewer than the 10 prizes, so under the terms every entry in the draw won a prize. Here's the order the script gave:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;8468d540-2606-4d99-a329-e2308b4efbdb&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;74e0f78f-4f40-4193-baa3-e6b5edca19fe&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;898def2a-1de2-49ae-8051-9a979841dbae&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;3acb4539-6508-4003-bff1-46c227ab3f3b&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;f9598fed-90b0-41ea-a962-84f12c5c0200&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;a1e8a990-21bd-4a2b-9628-00a1c67b27a1&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Rerun it yourself
&lt;/h2&gt;

&lt;p&gt;The whole script is 66 lines with no dependencies beyond the Python standard library. Download it from &lt;a href="https://carcheckhq.com/giveaway/draw.py" rel="noopener noreferrer"&gt;carcheckhq.com/giveaway/draw.py&lt;/a&gt; and check it's the same file we used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sha256sum draw.py
&lt;span class="c"&gt;# 124787266705120f0039a3cde2bfefcaf1b8e46a11a72ffb51302c1d7d56475a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Download the published list of entry IDs from &lt;a href="https://carcheckhq.com/giveaway/g1-entries.csv" rel="noopener noreferrer"&gt;carcheckhq.com/giveaway/g1-entries.csv&lt;/a&gt;, save it as &lt;code&gt;entries.csv&lt;/code&gt; and check its sha256sum matches the value above. Then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 draw.py entries.csv --round 34210612 --winners 10 --reserves 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You get a small JSON block: entries, entry_list_sha256, drand_round, drand_randomness, seed, winners and reserves_in_order. Every field should match what's on our &lt;a href="https://carcheckhq.com/giveaway" rel="noopener noreferrer"&gt;giveaway results page&lt;/a&gt;. If you'd rather not touch the network, pass the random value in with &lt;code&gt;--randomness&lt;/code&gt; and it runs fully offline.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we'd do differently
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Publish the entry-ID list earlier.&lt;/strong&gt; The fingerprint proves the list didn't change, but people can only rerun the shuffle once they have the list itself. Next time the list goes up the moment entries close.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pin the script hash in the terms from day one.&lt;/strong&gt; We did this, and it's the bit that stops anyone (us included) from tweaking the code after seeing the drand value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep it boring.&lt;/strong&gt; No database, no service, no admin panel. One CSV, one public random number, one script. The less there is, the less there is to argue about.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you run a giveaway, a raffle for a club or school, or anything where people need to trust a random pick, feel free to borrow the approach. The pattern is simple: fix the entries, fix the future randomness source, publish both, and let anyone replay it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;CarCheckHQ is run by DESKLINK LTD (company 17076467, England and Wales). We're independent and not linked to the DVLA or DVSA.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>opensource</category>
      <category>security</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Treat a used car's log book like a log file: what a V5C proves and what it doesn't</title>
      <dc:creator>UK Used Car Notes</dc:creator>
      <pubDate>Sun, 01 Nov 2026 20:21:56 +0000</pubDate>
      <link>https://dev.to/ukusedcarnotes/treat-a-used-cars-log-book-like-a-log-file-what-a-v5c-proves-and-what-it-doesnt-4p4h</link>
      <guid>https://dev.to/ukusedcarnotes/treat-a-used-cars-log-book-like-a-log-file-what-a-v5c-proves-and-what-it-doesnt-4p4h</guid>
      <description>&lt;p&gt;If you've ever trusted a log file a bit too much, you already know the trap with buying a used car in the UK. The V5C (the "log book") looks official, it's printed on watermarked paper, and it has the seller's name on it. So it must prove they own the car, right?&lt;/p&gt;

&lt;p&gt;It doesn't. And knowing exactly what it does and doesn't tell you saves a lot of grief.&lt;/p&gt;

&lt;p&gt;Quick disclosure: I'm part of the small team behind CarCheckHQ, a UK car history check site. This post isn't a pitch though. Most of what follows is free to do yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one-line version
&lt;/h2&gt;

&lt;p&gt;A V5C names the &lt;strong&gt;registered keeper&lt;/strong&gt;, not the owner. GOV.UK says it plainly: the V5C is not proof of ownership.&lt;/p&gt;

&lt;p&gt;The keeper is the person who gets the letters, the parking tickets and the speeding notices. The owner is whoever actually paid for it. Often that's the same person. Plenty of times it isn't:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Company cars, where the business owns it but the driver is on the log book.&lt;/li&gt;
&lt;li&gt;Lease cars, where the leasing company usually sits on the V5C and a finance company owns it.&lt;/li&gt;
&lt;li&gt;Hire purchase, where you don't own the car until the last payment clears.&lt;/li&gt;
&lt;li&gt;Couples, where one name is on the paper and the car is shared.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So when a seller waves the log book at you, read it like a log entry. It tells you something real happened. It doesn't tell you the whole story.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the V5C is genuinely good for
&lt;/h2&gt;

&lt;p&gt;Think of it as a checksum. It's brilliant for spotting things that don't match:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;VIN and engine number.&lt;/strong&gt; Find the VIN on the car (usually the base of the windscreen and a plate in the door frame) and check it against the log book. If they differ, walk away. No exceptions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Registration, colour and make.&lt;/strong&gt; Put the reg into GOV.UK's free vehicle enquiry and compare. A blue car that the record says is silver is worth a question.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The paper itself.&lt;/strong&gt; Hold it up to the light and look for the "DVL" watermark. GOV.UK also publishes the serial number ranges of blank V5Cs that were stolen, so it's worth a look.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Is it the latest one?&lt;/strong&gt; The free GOV.UK service shows the date the last V5C was issued. If the seller's copy is older than that, someone has a newer log book, and you want to know who.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keeper's address.&lt;/strong&gt; Ideally you're viewing the car at the address printed on it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What it can't tell you
&lt;/h2&gt;

&lt;p&gt;This is where people get caught out. The log book says nothing about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Outstanding finance. A car with an HP agreement still running can have a perfectly normal V5C.&lt;/li&gt;
&lt;li&gt;Whether the seller has the right to sell it.&lt;/li&gt;
&lt;li&gt;Most write-off history. A Cat S car's log book should show the category, but a Cat N one won't.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We wrote up the keeper versus owner question in more detail in our guide on &lt;a href="https://carcheckhq.com/guides/does-a-v5c-prove-ownership" rel="noopener noreferrer"&gt;whether a V5C proves ownership&lt;/a&gt;, with the GOV.UK and Citizens Advice sources linked.&lt;/p&gt;

&lt;h2&gt;
  
  
  So how do you actually check ownership?
&lt;/h2&gt;

&lt;p&gt;Ask for proof beyond the log book. Things a genuine private seller can usually show:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The original purchase invoice or receipt with their name on it.&lt;/li&gt;
&lt;li&gt;A finance settlement letter if they had a loan or HP on it.&lt;/li&gt;
&lt;li&gt;Service history with matching names and addresses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the seller isn't the registered keeper, ask why and listen to the answer. "It's my partner's car and she's at work" can be fine. "I'm selling it for a mate" with no way to reach the mate is not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pay last, and pay with a paper trail
&lt;/h2&gt;

&lt;p&gt;Here's the order I'd stick to, every time:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check the reg and MOT history before you travel.&lt;/li&gt;
&lt;li&gt;View at the keeper's address and do the VIN and log book checks above.&lt;/li&gt;
&lt;li&gt;Run a history check for finance and write-off records.&lt;/li&gt;
&lt;li&gt;Only then pay, standing next to the car.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;How you pay matters too. If you're buying from a trader, putting even part of the price on a credit card can give you Section 75 protection on cars between £100 and £30,000. With a private seller it's usually a bank transfer, so pay attention when your banking app runs Confirmation of Payee. If the account name doesn't match the person in front of you, stop and ask why.&lt;/p&gt;

&lt;p&gt;Then write a simple receipt: date, price, both names and addresses, the reg and the mileage, signed by you both. Keep the bank record with it. Our guide on &lt;a href="https://carcheckhq.com/guides/paying-for-a-used-car-safely" rel="noopener noreferrer"&gt;paying for a used car safely&lt;/a&gt; compares cash, cards, transfers and finance side by side.&lt;/p&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;The V5C is a great tool for catching mismatches and a terrible tool for proving ownership. Use it to check the VIN, the reg and the paper, then get proof of ownership and a finance check from somewhere else. Pay last, get a receipt, and leave with the keys and the new keeper slip.&lt;/p&gt;

&lt;p&gt;Have you ever had a log book that didn't quite add up? I'd love to hear what tipped you off.&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>beginners</category>
      <category>uk</category>
    </item>
  </channel>
</rss>
