user8215: I was wondering how to create the policy Id/script for the cardano assets.
I am new to cardano blockchain but I have worked on Ethereum. I read the docs provided by the cardano officials but couldn't find any possible way on how to work with this lib. Moreover, there is no information provided by cardano on how to use this lib or possibly I could find it.
Please provide the information about how to use this lib.
Thank you..

user4627: You can find a full example here in the the /doc/getting-started folder of the serialization lib:
https://github.com/Emurgo/cardano-serialization-lib/blob/master/doc/getting-started/minting-nfts.md
You basically compose your script depending on your requirements, e.g. by creating a scripts object via NativeScripts.new(), adding the individual script components (timelock / pub key hash) to that and wrapping them in a new_script_all() script.
The "policy id" is a hex representation of the final script hash, received like this (from the example above):
const policyId = Buffer.from(mintScript.hash().to_bytes()).toString("hex");

console.log(`POLICY_ID: ${policyId}`);


8215: <p>I was wondering how to create the policy Id/script for the cardano assets.
I am new to cardano blockchain but I have worked on Ethereum. I read the docs provided by the cardano officials but couldn't find any possible way on how to work with this lib. Moreover, there is no information provided by cardano on how to use this lib or possibly I could find it.
Please provide the information about how to use this lib.
Thank you..</p>
 4627: <p>You can find a full example here in the the <em>/doc/getting-started</em> folder of the serialization lib:</p>
<p><a href="https://github.com/Emurgo/cardano-serialization-lib/blob/master/doc/getting-started/minting-nfts.md" rel="nofollow noreferrer">https://github.com/Emurgo/cardano-serialization-lib/blob/master/doc/getting-started/minting-nfts.md</a></p>
<p>You basically compose your script depending on your requirements, e.g. by creating a scripts object via <code>NativeScripts.new()</code>, adding the individual script components <em>(timelock / pub key hash)</em> to that and wrapping them in a <code>new_script_all()</code> script.</p>
<p>The <em>&quot;policy id&quot;</em> is a hex representation of the final script hash, received like this <em>(from the example above)</em>:</p>
<pre><code>const policyId = Buffer.from(mintScript.hash().to_bytes()).toString(&quot;hex&quot;);

console.log(`POLICY_ID: ${policyId}`);
</code></pre>
