Skip to content
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

[REQUEST] Allow additional MST in and outputs in a MIT transfer #364

Open
canguruhh opened this issue Jan 10, 2020 · 2 comments
Open

[REQUEST] Allow additional MST in and outputs in a MIT transfer #364

canguruhh opened this issue Jan 10, 2020 · 2 comments

Comments

@canguruhh
Copy link
Member

Currently a MIT transfer does not allow to send additional ETP or MST. This would be required for a transaction in which someone wants to receive a MST in return of MITs.

Alice wants to sell a MIT. Bob wants to buy it and they already decided about a price of 10 DNA.

They manually create a transaction in which there is the MIT input from Alice, the DNA input from Bob (Must be >=10 DNA) as well as ETP input to cover the transaction fees. The outputs are the MIT to Bob, 10 DNA to Alice and the change outputs (rest of the DNA and rest of the ETP).

For this functionality we do not need a mvs-cli command. The transaction will be created externally but is required to be validated by the mvsd transaction validation.

ATTENTION: Please check for the implementation of #363 which should work similar

@baidang201
Copy link
Contributor

@baidang201
Copy link
Contributor

Allow additional MST in and outputs in a MIT transfer is work in https://github.com/baidang201/metaverse/tree/364-additional-MST-in-MIT-transfer
here is a example.
./mvs-cli sendrawtx 0400000003d3ce810723882ec877143e3f0f02ec1b9d56f34056e9416c644bb9032d26df42000000006a47304402201c346628687bd35b67729cf1be9ef86df4719b118cfce1ae4192f1c9cbd1eb15022031e0ad1d5d524f8e32bdc13a18f8d90f699086ab3a2d743b523500aa090b0f0b0121033de54c9954a230dbc2301cd052d9b3efeab2dce06edc8798ca9c0b99c8cd4354ffffffffd3ce810723882ec877143e3f0f02ec1b9d56f34056e9416c644bb9032d26df42010000006b483045022100899678e61bf4e8dad2ac3725b65d87dd0fa7d10bdac298c03840077e168cf89402201effa0b66d134aae50d2c04bbbce7fef3f0d77f4630a981ffce2f3b50386b3800121033de54c9954a230dbc2301cd052d9b3efeab2dce06edc8798ca9c0b99c8cd4354ffffffff07ea45ebb3104ca7fe32852a5713fceb204ec6d7e6db46a0b565df4885fc7243000000006b483045022100a4e9ea3038dc81d471b779675a7b0999763e93ce9e65a67a005e6a96443d7344022059f7e6d99545194c40cb75ff94a42d409e736df7e98cbd610e687e459c023e570121033de54c9954a230dbc2301cd052d9b3efeab2dce06edc8798ca9c0b99c8cd4354ffffffff0401000000000000001976a914e9ac8af9206f1e4584ab6da6ab91186e5847257188ac010000000000000000000000000000001976a914e9ac8af9206f1e4584ab6da6ab91186e5847257188ac0100000002000000020000000344414e010000000000000000000000000000001976a914ddfdc8dc65acf591d0c32ca72dbbc764afd0b1ed88ac0100000002000000020000000344414e090000000000000000000000000000001976a914e9ac8af9206f1e4584ab6da6ab91186e5847257188ac010000000600000002074d56532e545454224d5643694e6364444e647847336442353363363137464b3579336d65767176424a5700000000

{
"hash" : "5c102feb77d984dd4b2784a73aa6aa03c65820ac6ad1416004d66d12b1e68acf",
"inputs" :
[
{
"address" : "MU8wb66pXDLSw8qVxDAzvRiddBBCvjt7tr",
"previous_output" :
{
"hash" : "42df262d03b94b646c41e95640f3569d1bec020f3f3e1477c82e88230781ced3",
"index" : 0
},
"script" : "[ 304402201c346628687bd35b67729cf1be9ef86df4719b118cfce1ae4192f1c9cbd1eb15022031e0ad1d5d524f8e32bdc13a18f8d90f699086ab3a2d743b523500aa090b0f0b01 ] [ 033de54c9954a230dbc2301cd052d9b3efeab2dce06edc8798ca9c0b99c8cd4354 ]",
"sequence" : 4294967295
},
{
"address" : "MU8wb66pXDLSw8qVxDAzvRiddBBCvjt7tr",
"previous_output" :
{
"hash" : "42df262d03b94b646c41e95640f3569d1bec020f3f3e1477c82e88230781ced3",
"index" : 1
},
"script" : "[ 3045022100899678e61bf4e8dad2ac3725b65d87dd0fa7d10bdac298c03840077e168cf89402201effa0b66d134aae50d2c04bbbce7fef3f0d77f4630a981ffce2f3b50386b38001 ] [ 033de54c9954a230dbc2301cd052d9b3efeab2dce06edc8798ca9c0b99c8cd4354 ]",
"sequence" : 4294967295
},
{
"address" : "MU8wb66pXDLSw8qVxDAzvRiddBBCvjt7tr",
"previous_output" :
{
"hash" : "4372fc8548df65b5a046dbe6d7c64e20ebfc13572a8532fea74c10b3eb45ea07",
"index" : 0
},
"script" : "[ 3045022100a4e9ea3038dc81d471b779675a7b0999763e93ce9e65a67a005e6a96443d7344022059f7e6d99545194c40cb75ff94a42d409e736df7e98cbd610e687e459c023e5701 ] [ 033de54c9954a230dbc2301cd052d9b3efeab2dce06edc8798ca9c0b99c8cd4354 ]",
"sequence" : 4294967295
}
],
"lock_time" : "0",
"outputs" :
[
{
"address" : "MVCiNcdDNdxG3dB53c617FK5y3mevqvBJW",
"attachment" :
{
"type" : "etp"
},
"index" : 0,
"locked_height_range" : 0,
"script" : "dup hash160 [ e9ac8af9206f1e4584ab6da6ab91186e58472571 ] equalverify checksig",
"value" : 1
},
{
"address" : "MVCiNcdDNdxG3dB53c617FK5y3mevqvBJW",
"attachment" :
{
"quantity" : 1,
"symbol" : "DAN",
"type" : "asset-transfer"
},
"index" : 1,
"locked_height_range" : 0,
"script" : "dup hash160 [ e9ac8af9206f1e4584ab6da6ab91186e58472571 ] equalverify checksig",
"value" : 0
},
{
"address" : "MU8wb66pXDLSw8qVxDAzvRiddBBCvjt7tr",
"attachment" :
{
"quantity" : 9,
"symbol" : "DAN",
"type" : "asset-transfer"
},
"index" : 2,
"locked_height_range" : 0,
"script" : "dup hash160 [ ddfdc8dc65acf591d0c32ca72dbbc764afd0b1ed ] equalverify checksig",
"value" : 0
},
{
"address" : "MVCiNcdDNdxG3dB53c617FK5y3mevqvBJW",
"attachment" :
{
"address" : "MVCiNcdDNdxG3dB53c617FK5y3mevqvBJW",
"status" : "transfered",
"symbol" : "MVS.TTT",
"type" : "mit"
},
"index" : 3,
"locked_height_range" : 0,
"script" : "dup hash160 [ e9ac8af9206f1e4584ab6da6ab91186e58472571 ] equalverify checksig",
"value" : 0
}
],
"version" : "4"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants