Convert an owned object to a shared object

If an object has key and store properties, how can we convert the owned object to a shared object in Sui Move?

1 Like

If an object is owned (meaning that it was transferred to an address), it cannot later be shared. The call to transfer::share_object or transfer::public_share_object will fail if the object is not newly created in the transaction, or was an existing shared object that was passed by value into the transaction.

Thank you @amnn for sharing the information. However It is also mentioned in the transfer module source code that this may be relaxed in the future?

Is there any technical limitation on why can’t an owned object be converted to Shared Object.

There are no current plans to relax this restriction.

The complication with taking an existing owned object and making it shared is related to the relationship between the owned object fast path and consensus. These two systems use different methods for deciding which version of the object is used and making sure that the same object version is not used twice and it is tricky to have an object cross this boundary while maintaining the “no double use” property.