-
Notifications
You must be signed in to change notification settings - Fork 173
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
How to create a batch of dids? #210
Comments
To create 1000 DIDs for IOT devices, you wouldn't need 1000 BTC transactions, but only a fraction. Furthermore costs can be shared among many users. e.g. ION is able to bundle thousands of pluriform identifier events in a Merkletree-like structure and only the root hash will be anchored on the bitcoin blockchain. In your specific question, it depends whether you're able to batch the inception events of the IoT identifiers or not. A batch of 1000 identifiers requires 1 BTC transaction and there's even more room in that ION batch. 1000 consecutive inception events over of period of time, could require 1000 BTC transactions, but of course a single identifier event in one anchoring ION BTC transaction should not have to pay for the total fee. The fee can be shared and divided by the number of participating controllers in that specific ION anchoring BTC transaction. How can I do create them in a batch? -> Use a Sidetree based solution like ION or ORB. A more detailed answer on the exact technical approach to batch them in either environment should come from another community member, I don't have that knowledge. |
@henkvancann Thanks for the explanation. |
@thomas-tran pretty sure the node already ships set to batch requests, so if you wanted to batch then write, you'd use the API to send your running node N number of ops, then it will batch them up for you and anchor them (assuming you attach a funded wallet that can do txns). There's one big caveat: anchoring thousand of ION ops is going to require you to have enough in the wallet to lock an escrow-like proof of fee, which uses a relative timelock that will freeze a large amount of Bitcoin for roughly 30 days. It's a form of spam protection for the network. You can so 100 ops in a Bitcoin txn without any proof of fee value lock. @thehenrytsai please confirm |
@thomas-tran this doc explains the value locking proof of fee requirement the nodes all enforce: https://github.com/decentralized-identity/ion/blob/master/docs/design.md#value-locking-algorithm |
@csuwildcat can you point me to the right API or source code that allow to batch no of create operations e.g. I need to create 100 dids at once. I've checked the source code and I found this information. However, I assume that this only handle 1 did create request at the time. https://github.com/decentralized-identity/ion/blob/master/src/core.ts |
@thomas-tran, assuming you are running your own node, you simply need to submit 100 create operations to your node (ie. The technical spec for constructing a create request can be found in Sidetree API spec, but if you know TypeScript, you are better off using the ion-sdk directly, it will save you a lot of time. |
@thehenrytsai Thanks for the explanation. Where is the configuration to change batch writer waiting time in the node? |
Assuming you are running against mainnet using the setup guide:
|
Thank you @thehenrytsai @csuwildcat |
In your Q & A section,
Each newly created ID will pay a transaction fee?
With ION can fit 10,000 ID operations in a single bitcoin transaction.
Can you explain more detail on this? Assume that the company requires to create 1000 DIDs for IOT devices. Does it cost only a single bitcoin transaction or 1000 transactions? How can I do create them in a batch?
Thanks
The text was updated successfully, but these errors were encountered: