<p>The amount of memory that scrypt uses can be adjusted to get the desired behavior. If a particular CPU has enough L2 memory to hold all that's needed for a particular scrypt use case, then the performance of system memory will not be relevant. Scrypt-based coins can increase the memory requirements dynamically as one way of increasing the mining difficulty.</p>

CC BY-SA 3.0
2014-01-08T23:37:53.140Z
2014-01-08T23:37:53.140Z
David Schwartz
<p>Litecoin use scrypt with 128 KB of memory (<a href="http://en.wikipedia.org/wiki/Scrypt#Litecoin_proof-of-work" rel="nofollow">source</a>), therefore it can be stored in the CPU cache.</p>

<p>Scrypt is a sequential memory-hard hash function. You can tell it, how much memory it should use to generate a hash. You can even tell it to use GBs, in fact. The problem is, you always need that much memory to verify a hash. This will make hardware very expensive and the generation rate will be much lower.</p>

CC BY-SA 3.0
2014-01-09T21:47:47.437Z
in my experience it seems to run out of memory only when the GPU does, so it doesn't seem to be using the system RAM(I can tell because the limit is higher for some GPUs than others, even with the same amount of system ram)
ZCoder
CC BY-SA 4.0
2018-07-06T11:35:43.777Z
Litecoin uses low scrypt parameters to allow clients to *verify* the computed result fast enough. In case of proof-of-work cryptocurrency, all clients need to be able to verify the proof of work and if scrypt were used with high parameter values, that verification would be too costly.
Mikko Rantalainen
CC BY-SA 3.0
2014-01-09T11:06:57.757Z
2014-01-09T11:06:57.757Z
oleksii
<p>I saw in some places that Scrypt uses a lot of memory, therefore a good supply of system RAM is needed to hash with it. however, I saw in other places stating that is ONLY uses L2 Memory.
which one does it use?</p>

<litecoin><scrypt>
how does Scrypt use memory?
ZCoder
# how does Scrypt use memory?

(Asked by: username_0 on 2014-01-08)

I saw in some places that Scrypt uses a lot of memory, therefore a good supply of system RAM is needed to hash with it. however, I saw in other places stating that is ONLY uses L2 Memory.
which one does it use?

**Tags:** litecoin, scrypt


---

## 2 answers

### Answer by username_1 on 2014-01-08. Score: 3

The amount of memory that scrypt uses can be adjusted to get the desired behavior. If a particular CPU has enough L2 memory to hold all that's needed for a particular scrypt use case, then the performance of system memory will not be relevant. Scrypt-based coins can increase the memory requirements dynamically as one way of increasing the mining difficulty.


---

### Answer by username_2 on 2014-01-09. Score: 2

Litecoin use scrypt with 128 KB of memory ([source](http://en.wikipedia.org/wiki/Scrypt#Litecoin_proof-of-work)), therefore it can be stored in the CPU cache.

Scrypt is a sequential memory-hard hash function. You can tell it, how much memory it should use to generate a hash. You can even tell it to use GBs, in fact. The problem is, you always need that much memory to verify a hash. This will make hardware very expensive and the generation rate will be much lower.

> **Comments:**
> **username_0**: in my experience it seems to run out of memory only when the GPU does, so it doesn't seem to be using the system RAM(I can tell because the limit is higher for some GPUs than others, even with the same amount of system ram)  
> **username_3**: Litecoin uses low scrypt parameters to allow clients to *verify* the computed result fast enough. In case of proof-of-work cryptocurrency, all clients need to be able to verify the proof of work and if scrypt were used with high parameter values, that verification would be too costly.  

---

