-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creators and collection batch mint verifications #204
Conversation
blockbuster/blockbuster/Cargo.toml
Outdated
spl-account-compression = { git = "https://github.com/StanChe/solana-program-library.git", branch = "feature/init_with_root", features = ["no-entrypoint"] } | ||
spl-noop = { git = "https://github.com/StanChe/solana-program-library.git", branch = "feature/init_with_root", features = ["no-entrypoint"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could also use workspace import here
Co-authored-by: Stanislav Cherviakov <[email protected]>
) -> Self { | ||
Self { | ||
rightmost_root: args.rightmost_root, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets rename to just 'root'?
@@ -545,9 +555,39 @@ impl<T: ConnectionTrait + TransactionTrait, D: BatchMintDownloader> BatchMintPer | |||
} | |||
} | |||
|
|||
pub async fn validate_batch_mint(batch_mint: &BatchMint) -> Result<(), BatchMintValidationError> { | |||
pub async fn validate_batch_mint( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now we can use validation from sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, we have separate ticket for these changes
@@ -11,7 +11,7 @@ use spl_concurrent_merkle_tree::concurrent_merkle_tree::ConcurrentMerkleTree; | |||
use std::collections::HashMap; | |||
use std::str::FromStr; | |||
|
|||
pub fn generate_batch_mint(size: usize) -> BatchMint { | |||
pub fn generate_batch_mint(size: usize, creators_verified: bool) -> BatchMint { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fn also can be imported from sdk
What
This PR adds creator and collection verifications to the batch mint operation.
Why
Some of the assets in batch minting may have verified creators and collections.
Typically, creators should verify themselves by sending a transaction, which involves signature verification. In the batch minting implementation, a similar functionality is included. Here, creators must sign a hash and include this hash in the batch mint JSON file. On the indexer side, we verify the validity of the signature. If everything is correct, the creator is verified.
For collection verification, a special instruction
finalize_tree_with_root_and_collection
must be sent. The success of this transaction proves that the collection is verified by its creator. On the indexer side, we need to check if the collection in the batch mint object matches the one in the instruction.How
Several new checks have been added to the batch mint persister to verify creators and collections. Additionally, parsing of the
finalize_tree_with_root_and_collection
Bubblegum instruction has been implemented. The new functionality is also covered with tests.