docs: Fix misleading (#579)

This commit is contained in:
Yihau Chen 2021-08-05 16:15:18 +08:00 committed by GitHub
parent 0c51fc7ddb
commit f6329ceef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -56,7 +56,8 @@ allowing you to omit the `Rent` acccount), you can specify
::: details
All accounts created with Anchor are laid out as follows: `8-byte-discriminator || borsh
serialized data`. The 8-byte-discriminator is created from the first 8 bytes of the
`Sha256` hash of the account's type--using the example above, `sha256("MyAccount")[..8]`.
`Sha256` hash of the account's type--using the example above, `sha256("account:MyAccount")[..8]`.
The `account:` is a fixed prefix.
Importantly, this allows a program to know for certain an account is indeed of a given type.
Without it, a program would be vulnerable to account injection attacks, where a malicious user