Skip to content
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

Merged
merged 5 commits into from
Aug 14, 2024

Conversation

n00m4d
Copy link

@n00m4d n00m4d commented Aug 7, 2024

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.

@n00m4d n00m4d requested review from RequescoS and danenbm August 7, 2024 21:50
Comment on lines 14 to 15
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"] }
Copy link

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

blockbuster/blockbuster/src/programs/bubblegum/mod.rs Outdated Show resolved Hide resolved
) -> Self {
Self {
rightmost_root: args.rightmost_root,

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(

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

Copy link
Author

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 {

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

@n00m4d n00m4d merged commit d37f4c9 into feat/rollup-indexing Aug 14, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants