Napster Clone
by Roedy Green ©1996-2008 Canadian Mind Products
This essay is about a suggested
student project in
Java programming. This essay gives a rough overview of how it might work. It
does not describe an actual complete program. I have
no source, object,
specifications, file layouts or anything else useful to implementing this
project. Everything I have to say to help you with this project is written below.
I am
not prepared to help you implement it; I have too many other
projects of my own.
I do contract work for a living, which could include writing a program such as
this. However, I don’t do people’s homework
for them. That just robs them of an education.
You have my full permission to implement this project any way you please.

The CurrCon
Java Applet displays prices on this web page converted with today’s
exchange rates into your local international currency, e.g. Euros, US dollars,
Canadian dollars, British Pounds, Indian Rupees… CurrCon requires Java
1.1 or later, preferably 1.6.0_06 . If you can’t
see the prices, of you if just want to learn more about CurrCon, click
here
for help.
This project is similar to the Bulk File
Distributor project. If you are not familiar with Napster,
you must have been living in a cave. It is a great idea, implemented with
infuriatingly inept code. My vision, dating back decades, is a legitimate
electronic music distribution scheme where every song ever recorded was
instantly on tap. You do not need to go shopping. You just play what you like
and pay a bill every month, like your phone bill. Music is cheap because it does
not need to be advertised or put on plastic discs, shipped about in trucks,
inventoried or displayed in expensive retail space.
What would a legitimate Napster replacement need?
- No more dreaded "file transfer error". Napster just totally gives up
on the slightest hint of trouble. What it should do is restart the transfer,
picking up where it left off, using a different source, if available.
- Songs must be accurately indexed. Napster is total chaos. You can’t search
for "Gay"; as recording artist without also getting comedy sketches
about Captain Kirk coming on to Spock. You need accurate artist names, accurate
album titles, accurate song names, accurate album serial numbers.
- Napster searches bring up dozens of duplicates. It should bring up each song
title separately, and once you select the song title of interest it could show
you the variants available and the estimated time to get each one. The system
should select the best source for you automatically. The system can then fairly
allocate the work.
- People who download a recording should be able to rate it for various sorts of
quality. You should be able to access those statistics as well as individual
comments.
- Napster has no facility to sell music. It only handles free music. It should be
possible to try before you buy. It should be useful both for individual
musicians and recording companies to sell music. You might buy ten plays for a
nickel, 100 plays for a quarter, or lifetime use for a dollar. Or you might just
pay a flat fee of
a month for all your music, much the way you pay a flat fee for Internet access.
Napster has to track what people download and what they play to compute the bill.
You might have a “gastank” system, like Digicash where you prepay,
or it might be a charge put on your credit card or an itemised bill than arrives
each month. The technically tricky part comes working out a scheme so that
purchased music cannot be shared. Since you can hear all music at least a few
times free, there is less incentive to try to crack the sharing scheme than
there is now to steal when CD’s cost
.
- Once Napster went legit, it could legally cache popular songs on high speed
servers, giving much faster downloads than now.
- You need to support some higher quality message formats, and allow for the
option of new formats to be introduced from time to time.
- The current music distribution system rewards someone equally if you buy their
CD and play it once and if you play it every day for the rest of your life.
Surely the second artist should be more amply rewarded.
The key to autorestart is to compute a 64 bit digest
for each file. Two identical files have the same digest. As long as two files
have the same digest, you can safely restart with the second file.
The payment scheme would be based on public key encryption and digital
signatures. For some hints of how the scheme would work, see my essay on digital
signatures. The idea each client has a private key (a random binary number)
they can use to prove their identity by encrypting a challenge phrase from the
server that the server then decrypts with the client’s registered public
key. This ensures that other people can’t get music and bill it to you.
Music can be passed around encrypted on the web, along with, and in exactly the
same way that free music is freely passed around now. You pay nothing to
download the music, but you only get the decryption keys once you have been
authorised for a free trial or yet another play. There are at least four ways a
pirate might cheat:
- Tell other people the decryption keys.
- Keep a copy of the unencrypted trial play file, and play it as many times as he
pleases.
- Put up a copy of the unencrypted file on Napster.
- Play the file, and create a new digital file from the analog output to the
loudspeakers.
What might you do to make each sort of cheating more trouble than it’s
worth:
- To prevent people from sharing decryption keys, don’t publicly distribute
the entire file. Leave parts of it out. When a users pays for a play, or is
determined to have the right to a play, the server sends him just the missing
parts, encrypted specifically for that target user with his public key. The file
can only be decrypted with the client’s private key. He dare not divulge
his private key or else people could bill music to his account.
- To prevent the user from keeping an unencrypted copy of the file, standard
software must simply not hand it over. The server software can challenge the
client software to ensure it has not been tampered with. Pirate software would
fail the dynamic challenge. If security were ever broken, new software can be
downloaded, and all old software disabled. This scheme simply stops the user
from saving the MP3 file (or the keys) in unencrypted form. It does not prevent
a pirate from recording the S/PDIF output of his sound card on his DAT drive. To
save it as an MP3 file, he would have to play the tape back, and run it through
a MP3 compressor. The pirate would have to manually type all the track titles.
Not everyone has this equipment so the amount of such copying might be
considerably lower than now when all you need is a computer. Pirates might
attack the sound card drivers, persuading them to save WAV files. Standard
software could check for these, much the way you check for viruses, and refuse
to function.
- The same techniques to prevent someone from saving an unencrypted MP3 for their
own use also makes it difficult for them to share them. In addition, it might be
possible to create a special sort of digest to identify a file. If a free file
matched the signature of one of the for pay ones, Napster could simply quietly
refuse to share it. Calculating this signature is tricky. There are many ways of
compressing a file, and each subtlely alters it. Pirates would have to alter the
sound to be sufficiently different from the original to bypass this check.
- I can conceive of no technology that could prevent recording the analog outputs,
save some sort of sealed unit headsets with wireless Internet access and
decoders in them. However, that sort of copying would lose fidelity, much like
copying cassette tapes.
How do you switch to such a new format? Music will have to continue to be sold
on CDs, which are sitting ducks for piracy? The music in the new format will
have to be higher fidelity, with better channel separation. New songs might come
out first in the new format, and only several months later in CD format. Songs
may make most of their sales and downloads in the first month after release. If
people already have the new format song, why would they need a pirated version
of inferior CD quality?
The RIAA must realise they can’t kill Napster. If they do, like the
mythological Hydra, ten more even more decentralised clones will rise in its
place. The only way to kill it is to offer huge amounts of high quality music at
low prices, including tons of music difficult to get in pirated form, and free
try before you buy. With electronic distribution, it costs almost nothing to
give people unlimited amounts of music. This cost saving must be passed on to
the consumer. The public is using wholesale piracy to punish the RIAA for being
so greedy and stubborn. Technology makes possible unlimited near-free choice.
Heaven help the fool who tries to stand in their way.
Music distribution will change. Retail outlets will be much less important.
There will be thousands of little home "radio" stations that construct
24 hour playlists with commentary. You will be able to get a discumentary on
almost any topic, not just music. They will be highly specialised. You can
subscribe to these for a penny an hour. They don’t actually distribute any
music, just playlists and commentary, that your player constructs into a
continous wallpaper of sound. You don’t have to listen to them in real
time, the way you do with broadcast radio. You are basically paying them to go
digging for you to find the great recordings in the mass of so so ones. Every
band will have at least one "radio" station. It would play that band’s
music, tell stories about the band, play interviews, compare cuts with other
bands that did the same song etc. You could go into the radio business with just
a PC, a mike and a sound card. There will be tens of thousands of people doing
the same thing for free, so the for pay ones will have to be top notch quality.
There will also be some using the old style of financing, with ads. The target
markets will be very specific, so these stations will be quite valuable to
advertisers.