You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to retrieve Resolvers from a fresh wallet restore the wallet will need to check every single Resolver box to see if it can be spent, this is done by checking if the wallet has the SK for the PK stored in R4.
This won't scale when there's many users and Resolvers minted.
Instead we could:
Embed the PK as a const in the contract
This would require a different way of checking script hash
val validScript =blake2b256(resolverOutBox.propositionBytes)==fromBase16("$resolverScriptHash")
will need to manually construct the script hash (blake2b256(const(pk) ++ restOfScriptBytes)) - there might actually be a function for this: def substConstants[T](scriptBytes: Coll[Byte], positions: Coll[Int], newValues: Coll[T]): Coll[Byte]
will this have impacts on other contracts checking for script hashes?
Then the wallet could check for script addresses with the wallets PKs
Consideration with this approach: We won't be able to embed the resolver script hash to check the out box script hash, we instead need to embed the resolver script prop bytes and use substConsts with the buyer pk - this could increase the size of boxes quite a lot if resolver contracts get more complicated (i.e if we add subresolvers).
Max size of boxes are 16kb, I think it's pretty likely we'd reach that limit if we were to include the prop bytes as a constant
Maybe we could have a "locator" nft that is also minted that will live at a P2PK address in the wallet enabling easy resolver box finding, adds a bit of complexity as there's an extra token that needs to be managed and traded when selling a resolver
The text was updated successfully, but these errors were encountered:
With this in place a users wallet can discover bitdomains related boxes by generating a batch of keys and querying the indexer r4 == key[i] && script == bitdomainsContract
In order to retrieve
Resolver
s from a fresh wallet restore the wallet will need to check every singleResolver
box to see if it can be spent, this is done by checking if the wallet has the SK for the PK stored in R4.This won't scale when there's many users and
Resolver
s minted.Instead we could:
contracts/contracts/v1/Registry/MintResolver.es
Line 79 in a1ba6fe
blake2b256(const(pk) ++ restOfScriptBytes)
) - there might actually be a function for this:def substConstants[T](scriptBytes: Coll[Byte], positions: Coll[Int], newValues: Coll[T]): Coll[Byte]
Consideration with this approach: We won't be able to embed the
resolver
script hash to check the out box script hash, we instead need to embed theresolver
script prop bytes and usesubstConsts
with the buyer pk - this could increase the size of boxes quite a lot ifresolver
contracts get more complicated (i.e if we add subresolvers).Max size of boxes are 16kb, I think it's pretty likely we'd reach that limit if we were to include the prop bytes as a constant
Maybe we could have a "locator" nft that is also minted that will live at a P2PK address in the wallet enabling easy resolver box finding, adds a bit of complexity as there's an extra token that needs to be managed and traded when selling a resolver
The text was updated successfully, but these errors were encountered: