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

Add Collection to the data_hash keccak::hashv #64

Open
c4b4d4 opened this issue Dec 28, 2023 · 0 comments
Open

Add Collection to the data_hash keccak::hashv #64

c4b4d4 opened this issue Dec 28, 2023 · 0 comments

Comments

@c4b4d4
Copy link

c4b4d4 commented Dec 28, 2023

Can we change this to take the "collection" in consideration when second-hashing the metadata?

Right now, to verify the collection we need to pass the entire Metadata to the instruction, which reduces composability because it increases the Transaction Size by A LOT.

// @dev: seller_fee_basis points is encoded twice so that it can be passed to marketplace
// instructions, without passing the entire, un-hashed MetadataArgs struct
let metadata_args_hash = keccak::hashv(&[message.try_to_vec()?.as_slice()]);
let data_hash = keccak::hashv(&[
    &metadata_args_hash.to_bytes(),
    &message.seller_fee_basis_points.to_le_bytes(),
]);

let data_hash = keccak::hashv(&[

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

No branches or pull requests

1 participant