Pins and packing
Pin profiles
Your names are saved as pins.json. The format follows the proposal in TAPs issue #44.
{
"name": "Adder16",
"circuit": {
"chainId": 196,
"processor": "0xCa6Fa40e0b548aBa9132F3f5050eE4C4c5eB7340",
"circuitId": "13"
},
"inputs": [
{ "name": "a", "bitOffset": 0, "bitWidth": 16, "type": "uint" },
{ "name": "b", "bitOffset": 16, "bitWidth": 16, "type": "uint" }
],
"outputs": [{ "name": "sum", "bitOffset": 0, "bitWidth": 17, "type": "uint" }],
"state": []
}Types are boolean (1 bit) and uint (up to 256 bits). Pins may not overlap. Inputs you leave unnamed are sent as 0.
How packing works
TAP-02 sends bits lowest first. Pin 0 is the lowest bit
of the first byte, and pin 8 is the lowest bit of the second. So pins 1, 1, 0, 1 become 0x0b, and the number 1200 becomes
b0 04.
The generated code handles this both ways, and rejects a value that is too big for its pin instead of cutting it short.