Suggestion: issuefromwithgrant

+2 votes
Let the user issue an asset from an address to another while setting permissions related to that address (not necessarily to either address!)

How I came up with: I need to create an asset between two parties, but have a Central Party be able to update a single field in the details using reissue. However, I can not let the user create the asset without giving this party this permission in order for the whole solution to work. Currently thinking of how I'm going to represent what I want.
asked Aug 8, 2019 by tloriato
Just realized that I could create my raw transaction for my solution, but I'll leave the suggestion!

1 Answer

+1 vote
I'm trying to implement my suggestion using createsawsendfrom but I'm having trouble setting the permission for asset, even though I can do it for globla permissions:

createrawsendfrom 1UBr2ZwsQh38vcLvcCSdyxF8KyvJsaYuQqii5X
'{"1YXee6pvEMjgtjQTSeRsaYZgC4iPYAWjVsih5A":{"issue":{"raw":0}},"1YXee6pvEMjgtjQTSeRsaYZgC4iPYAWjVsih5A":{"permissions":{"type":"ASSETNAME.issue"}}}' '[{"create":"asset","name":"ASSETNAME","multiple":10,"open":true,"details":{"origin":"uk","stage":"one"}}]' send

Gives:

error code: -8

error message:

Invalid value for permission type: ASSETNAME.issue
answered Aug 8, 2019 by tloriato
Tried also:

createrawsendfrom 1K5MpMjbJv98cPCBTVjqx7sD1qP5EC8jsQNM27 '{"1DaHoK9hTEpi3MaZxJ1R7ckZfXi7Y547AwqRe2":{"issue":{"raw":0}}, "17kyZx3rzoqVDdcqsV8AKntmRR7UTfUwyLiXBY":{"permissions":{"for":{"type":"asset", "name":"ASSETNAME"}},"issue":true}}' '[{"create":"asset","name":"ASSETNAME","multiple":10,"open":true,"details":{"origin":"uk","stage":"one"}}]' send

error code: -1
error message:
value is type obj, expected str
You need the form:

{"permissions":{"for":"ASSETNAME", "type":"issue"}}

See the example for per-stream permissions here:

https://www.multichain.com/developers/raw-transactions/
Thanks! I'm getting -708, it can't find the asset's name. Probably I can't do what I wanted in a single transaction? Or maybe I have to rearrange it somehow?
Oh yes, this is true, you cannot create a new asset and set a permission for it in a single transaction. Sorry I did not notice this before.

Could you instead use a transaction filter to prevent an asset being transacted after issuance until the appropriate party has this permission?
Probably not, to be honest, due to data replication through the explorer and redis. But I'll definitely think of something, it's ok. Thank you.
...