raw and muti signed transaction - UCHAIN-WORLD/uchain-fullnode GitHub Wiki

title: transaction


  • createrawtx

    createrawtx

    • Parameters (positional)
    1. -d or [--deposit] Deposits support [10, 45, 120, 240, 540] days. defaluts to 7 days
    2. -f or [--fee] Transaction fee. defaults to 10000 UCN bits
    3. -h or [--help] Get a description and instructions for this command.
    4. -i or [--message] Message/Information attached to this transaction
    5. -c or [--change] change to this address, includes ucn and asset change
    6. -n or [--symbol] asset name, not specify this option for ucn tx
    7. -r or [--receivers] Send to [address:amount]. amount is asset number if sybol option specified
    8. -s or [--senders] Send from addresses
    9. -t or [--type] Transaction type. 0 -- transfer ucn, 1 -- deposit ucn, 3 -- transfer token
    • Example
    uc-cli createrawtx -r UaWMHFWmZYwEFVbwEpaEeMHTm9UL451ZX8:10 -s UNfrtAxhJRi83PjTPjV3yNPKnjLYR22Bhx -s USa9SKiMHZ3TRcodvJi6oGVgS65iy47Hh4 -t 0
    040000000165c8c29c4f3cd3488fc16b67ec6dc4cb0d7bf7162201ccf1b937e43b9bacca850100000000ffffffff020a000000000000001976a914895e1ec4d6057ec2c66b77a06269b8bef211ddd288ac0100000000000000d6e97c1f8c5223011976a914078910a58cea508623e2be9b38beb6e7d576e88088ac010000000000000000000000
    
    

  • decoderawtx

    • Arguments (positional):
    1. TRANSACTION The input Base16 transaction to sign.
    • Example
    $ uc-cli decoderawtx 040000000165c8c29c4f3cd3488fc16b67ec6dc4cb0d7bf7162201ccf1b937e43b9bacca850100000000ffffffff020a000000000000001976a914895e1ec4d6057ec2c66b77a06269b8bef211ddd288ac0100000000000000d6e97c1f8c5223011976a914078910a58cea508623e2be9b38beb6e7d576e88088ac010000000000000000000000
    {
    	"hash" : "2f29b2dcbe05a1edf18a28471cc27690df8cc42f1e2b3e4000904b8a76f2e707",
    	"inputs" : 
    	[
    		{
    			"previous_output" : 
    			{
    				"hash" : "85caac9b3be437b9f1cc012216f77b0dcbc46dec676bc18f48d33c4f9cc2c865",
    				"index" : 1
    			},
    			"script" : "",
    			"sequence" : 4294967295
    		}
    	],
    	"lock_time" : "0",
    	"outputs" : 
    	[
    		{
    			"address" : "UaWMHFWmZYwEFVbwEpaEeMHTm9UL451ZX8",
    			"asset" : 
    			{
    				"type" : "ucn"
    			},
    			"index" : 0,
    			"locked_height_range" : 0,
    			"script" : "dup hash160 [ 895e1ec4d6057ec2c66b77a06269b8bef211ddd2 ] equalverify checksig",
    			"value" : 10
    		},
    		{
    			"address" : "UNfrtAxhJRi83PjTPjV3yNPKnjLYR22Bhx",
    			"asset" : 
    			{
    				"type" : "ucn"
    			},
    			"index" : 1,
    			"locked_height_range" : 0,
    			"script" : "dup hash160 [ 078910a58cea508623e2be9b38beb6e7d576e880 ] equalverify checksig",
    			"value" : 81999979999979990
    		}
    	],
    	"version" : "4"
    }
    
    

  • signrawtx

    signrawtx

    • Parameters (positional)
    1. WALLET_NAME Wallet name required.
    2. WALLET_AUTH Wallet password(authorization) required.
    3. TRANSACTION The input Base16 transaction to sign.
    • Example
    $ uc-cli signrawtx tony4 123456 02000000011b1cb3fc24c24e13a71e11f26fd3bc8c69ff15e1269783e09b276a23b6bf1e180000000000ffffffff0264000000000000001976a91404a31ae84a152ca773728761b7260726d8aeff8c88ac01000000000000008c7be111000000001976a91441064be4875b7a3608a891173540e534d4b89b6f88ac010000000000000000000000
    {
        "hash" : "cb1906fee17d72a4bc71cfdb5b0e0f66d7a5067fd941e74cd703367d384821ff",
        "rawtx" : "02000000011b1cb3fc24c24e13a71e11f26fd3bc8c69ff15e1269783e09b276a23b6bf1e18000000006b483045022100a59159cc8d3018899815e3189893c81b741166a7ee6e69cd5b04f989afe498e50220364a7b0a6ec0a0276e2019f372003b1fb88cb087791c368bb29bdff514ebb0ca012103046e1c2777cfa064932a2f4c12f8dd307c1702c9cd77d14c48daf134627e355effffffff0264000000000000001976a91404a31ae84a152ca773728761b7260726d8aeff8c88ac01000000000000008c7be111000000001976a91441064be4875b7a3608a891173540e534d4b89b6f88ac010000000000000000000000"
    }
    

}


  • sendrawtx

    • Options (named):
    1. -h or [--help] Get a description and instructions for this command.
    2. -f or [--fee] The max tx fee. default_value 10 ucn.
    • Arguments (positional):
    1. TRANSACTION The input Base16 transaction to broadcast.
    • Example
    $ uc-cli sendrawtx 02000000016164c4ccd70b57a9d7b956d63bf0d0c9bccb72cfaba49891fa9e833adacb65a401000000db00473044022042ccd72c3ce0f7bc34d4507964d6442877165e9efd8c45ca1b3f2721331f48f102200e5c1402d2775e87d258aa60feac3d79b2ba377e6665104196ad9ca75dc1c30b01483045022100b78987209417d81ffad5d45719e8a78a5730b6b8e22b98c73b6ca927a001fe6b022004b48edf88370fa001ae9423561762cbdd489b619ab82fcab64852e08358c7b0014c4752210200e5782241ce24af725f2e823dfcc325101cec604e422566ba5ce4ca4bd5bc8c2103046e1c2777cfa064932a2f4c12f8dd307c1702c9cd77d14c48daf134627e355e52aeffffffff0264000000000000001976a91404a31ae84a152ca773728761b7260726d8aeff8c88ac0100000000000000b83701000000000017a91409594fe3a84e3de95831d2474ca3ca29d2f9053d87010000000000000000000000
    aedd4bdf49a688cdfd23c056848149568a198f8088ac5e15fc38418dc429ae2a
    
    

  • checkpublickey

    Show public key of address

    • Parameters (positional)
    1. WALLET_NAME Wallet name.
    2. WALLET_AUTH Wallet password/authorization.
    3. ADDRESS Address.
    • Example
    $ uc-cli checkpublickey test 123456 MLTxV5JAu5sFhQmJYNRmPuu31CkNWrF5rj
    {
            "address" : "MLTxV5JAu5sFhQmJYNRmPuu31CkNWrF5rj",
            "public_key" : "031c7ac7f12a05ea4952289801fa52142aa421f11efe8ab7090fb823562156a321"
    }
    
    

    • createmultisigtx

    createmultisigtx

    • Parameters (named)
    1. -f or [--fee] The fee of tx. default_value 10000 ucn bits.
    2. -s or [--symbol] token name, not specify this option for UCN tx
    3. -t or [--type] Transaction type, defaults to 0. 0 -- transfer ucn, 3 -- transfer token
    • Parameters (positional)
    1. WALLET_NAME Wallet name.
    2. WALLET_AUTH Wallet password/authorization.
    3. FROMADDRESS Send from this address, must be a multi-signature script address.
    4. TOADDRESS Send to this address
    5. AMOUNT How many you will spend
    • Example
    $ uc-cli createmultisigtx test 123456 39hh1NY9xyTKzawD8zFKXgXa7XBwqck6BR MHaKHUFwAdcszvQarCmn1Rkq2uRoPQjZwm 3344
    02000000016453713104d144387553bcb0fa457f40d2dc5fb916bd9e2256835a4b6de48d4c00000000b500483045022100cbfdda943648344dc03fd92a905072082af93dfd4f166e3d1bb258e3437069790220321ee22c6a2543392909e21cd347d009a6d32173c23700424b45b4592d4075e3014c69522102729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b92103d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e2103f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e0253aeffffffff02100d0000000000001976a9146a20e940e8d7be0a49c598e91fa79c8b36e5353588ac0100000000000000d0fb01000000000017a91457e1a19e5ee4c0065f8fd76b0351fa145e44435a87010000000000000000000000
    
    
    • Example 2, send token
    $ uc-cli createmultisigtx -s BLOCK -t 3 test 123456 34EHRzpwKmFno8zPi3YvXBgqwzZGbYhS3a MKow3n2psKMwLuzufxoJzPycTyEiUcFJSQ 333
    02000000027228f5e854b565c2abc0c76d03be2b35aee4e6ee1d5df31bf586944b7a0230dc000000009300483045022100e483f215974cd4033887e48bb1a8db7dc5d7ed189078a8a1769efa643f7b8ea202205f4c803a979c910fcc23acfffebe0c7cb6c3e5354b8eaa0b5ba52159cdeda5ba014c47522102f611da5c3c78472855aad6af94b6e56521999f3884bc25165720349556b823062103d54aa74f5832252992cc61ce62bc91e66f2715720cb15256d1bf132fef1f777852aeffffffff1fef544624891be0b3b7e3374a6ebeba3b989b8609f1812e2333d1ffb756e7cc0000000092004730440220243819f923a1d2bea11c2da729a746886ab1d6deef980d8effc64e2acd472b580220042ff9c7e7df3c6911f0e52283b053b00452acb8be4bfc90aed9a98f24f83783014c47522102f611da5c3c78472855aad6af94b6e56521999f3884bc25165720349556b823062103d54aa74f5832252992cc61ce62bc91e66f2715720cb15256d1bf132fef1f777852aeffffffff0300000000000000001976a91482a46ca6e0ac21a3b41eff496a57a902ec47654788ac0100000002000000020000001a414c4943453230313830353138543131313730392e41535345544d010000000000003ec642480000000017a9141bda177776546d2766bcfac2fc7a87cae746de1e870100000000000000000000000000000017a9141bda177776546d2766bcfac2fc7a87cae746de1e870100000002000000020000001a414c4943453230313830353138543131313730392e41535345549b0200000000000000000000
    

  • createmultisigaddress

    create multi-signed address

    • Parameters (named)
    1. -d or [--description] multisig record description.
    2. -k or [--publickey] cosigner public key used for multisig
    3. -m or [--signaturenum] Wallet multisig signature number.
    4. -n or [--publickeynum] Wallet multisig public key number.
    5. -s or [--selfpublickey] the public key belongs to this wallet.
    • Parameters (positional)
    1. WALLET_NAME Wallet name.
    2. WALLET_AUTH Wallet password/authorization.
    • Example
    $ uc-cli createmultisigaddress -m 2 -n 2 -s 0386e78227d2e2a80e5d99a727a48b67501ea87223634544a38ae1c1720e59167d -k 020633c5cc2314f8a464c888ca4c98c4eac69cb468ec2e904decb8a5973bc17d84 yang 123456
    {
    "address" : "38fZvvVpYCKjtq3i7m1rsYffSQDBK97ktZ",
    "description" : "",
    "index" : 1,
    "m" : 2,
    "multisig_script" : "2 [ 020633c5cc2314f8a464c888ca4c98c4eac69cb468ec2e904decb8a5973bc17d84 ]  [ 0386e78227d2e2a80e5d99a727a48b67501ea87223634544a38ae1c1720e59167d ] 2 checkmultisig",
    "n" : 2,
    "public_keys" : 
    [
    	"020633c5cc2314f8a464c888ca4c98c4eac69cb468ec2e904decb8a5973bc17d84",
    	"0386e78227d2e2a80e5d99a727a48b67501ea87223634544a38ae1c1720e59167d"
    ],
    "self_publickey" : "0386e78227d2e2a80e5d99a727a48b67501ea87223634544a38ae1c1720e59167d"
    }
    
    

  • showmultisigaddresses

    Check multi-signed address.

    • Parameters (positional)
    1. WALLET_NAME Wallet name.
    2. WALLET_AUTH Wallet password/authorization.
    • Example
    $ uc-cli showmultisigaddresses test 123456
    [
    	{
    		"address" : "38fZvvVpYCKjtq3i7m1rsYffSQDBK97ktZ",
    		"description" : "",
    		"index" : 1,
    		"m" : 2,
    		"multisig_script" : "2 [ 020633c5cc2314f8a464c888ca4c98c4eac69cb468ec2e904decb8a5973bc17d84 ]  [ 0386e78227d2e2a80e5d99a727a48b67501ea87223634544a38ae1c1720e59167d ] 2 checkmultisig",
    		"n" : 2,
    		"public_keys" : 
    		[
    			"020633c5cc2314f8a464c888ca4c98c4eac69cb468ec2e904decb8a5973bc17d84",
    			"0386e78227d2e2a80e5d99a727a48b67501ea87223634544a38ae1c1720e59167d"
    		],
    		"self_publickey" : "0386e78227d2e2a80e5d99a727a48b67501ea87223634544a38ae1c1720e59167d"
    	}
    ]
    

    • deletemultisigaddress

    delete multi-signed address.

    • Parameters (positional)
    1. WALLET_NAME Wallet name.
    2. WALLET_AUTH Wallet password/authorization.
    • Example
    $ uc-cli deletemultisigaddress yang 123456 38fZvvVpYCKjtq3i7m1rsYffSQDBK97ktZ
    [
    	{
    		"address" : "38fZvvVpYCKjtq3i7m1rsYffSQDBK97ktZ",
    		"description" : "",
    		"index" : 1,
    		"m" : 2,
    		"multisig_script" : "2 [ 020633c5cc2314f8a464c888ca4c98c4eac69cb468ec2e904decb8a5973bc17d84 ]  [ 0386e78227d2e2a80e5d99a727a48b67501ea87223634544a38ae1c1720e59167d ] 2 checkmultisig",
    		"n" : 2,
    		"public_keys" : 
    		[
    			"020633c5cc2314f8a464c888ca4c98c4eac69cb468ec2e904decb8a5973bc17d84",
    			"0386e78227d2e2a80e5d99a727a48b67501ea87223634544a38ae1c1720e59167d"
    		],
    		"self_publickey" : "0386e78227d2e2a80e5d99a727a48b67501ea87223634544a38ae1c1720e59167d"
    	}
    ]
    
    


  • signmultisigtx

    signmultisigtx

    • Parameters (named)
    1. -b or [--broadcast] Broadcast the tx if it is fullly signed, disabled by default.
    2. -s or [--selfpublickey] The private key of this public key will be used to sign.
    • Parameters (positional)
    1. WALLET_NAME Wallet name.
    2. WALLET_AUTH Wallet password/authorization.
    3. TRANSACTION The input Base16 transaction to sign.
    • Example
    $ uc-cli signmultisigtx test 123456 -b 02000000016453713104d144387553bcb0fa457f40d2dc5fb916bd9e2256835a4b6de48d4c00000000b500483045022100cbfdda943648344dc03fd92a905072082af93dfd4f166e3d1bb258e3437069790220321ee22c6a2543392909e21cd347d009a6d32173c23700424b45b4592d4075e3014c69522102729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b92103d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e2103f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e0253aeffffffff02100d0000000000001976a9146a20e940e8d7be0a49c598e91fa79c8b36e5353588ac0100000000000000d0fb01000000000017a91457e1a19e5ee4c0065f8fd76b0351fa145e44435a87010000000000000000000000
    
    02000000016453713104d144387553bcb0fa457f40d2dc5fb916bd9e2256835a4b6de48d4c00000000fdfd0000483045022100cbfdda943648344dc03fd92a905072082af93dfd4f166e3d1bb258e3437069790220321ee22c6a2543392909e21cd347d009a6d32173c23700424b45b4592d4075e3014730440220018b6a113d89de18b6c3c7090758cf9e4ca24e7762a2796b872bf6d2d1015b96022046b4518aa9451e617dff9467db7fe0c0d45811d0884faed51e343fec2c4579ff014c69522102729cae0c16009f44440f306b76fafb7a7d2503741a619c15b41ff927c1afd6b92103d29f0b96f332e50d6014cb91c334214ecb8caf2881a97e7d944bdf4e5fd6a39e2103f97e079ccae21e1ee65d5ee64e5c27d7d6ce9a867cec75e9736ad5f258329e0253aeffffffff02100d0000000000001976a9146a20e940e8d7be0a49c598e91fa79c8b36e5353588ac0100000000000000d0fb01000000000017a91457e1a19e5ee4c0065f8fd76b0351fa145e44435a87010000000000000000000000